|
template<Record TRecord, std::predicate< const RecordMessage_t< TRecord > & > TUnaryPredicate> |
constexpr auto | sl::log::makeMessageFlushPolicyFor (TUnaryPredicate &&predicate) |
| Factory function for creating Flush-Policies based on Record::message member. More...
|
|
template<Record TRecord, std::predicate< const RecordSeverity_t< TRecord > & > TUnaryPredicate> |
constexpr auto | sl::log::makeSeverityFlushPolicyFor (TUnaryPredicate &&predicate) |
| Factory function for creating Flush-Policies based on Record::severity member. More...
|
|
template<Record TRecord, std::predicate< const RecordChannel_t< TRecord > & > TUnaryPredicate> |
constexpr auto | sl::log::makeChannelFlushPolicyFor (TUnaryPredicate &&predicate) |
| Factory function for creating Flush-Policies based on Record::channel member. More...
|
|
template<Record TRecord, std::predicate< const RecordTimePoint_t< TRecord > & > TUnaryPredicate> |
constexpr auto | sl::log::makeTimePointFlushPolicyFor (TUnaryPredicate &&predicate) |
| Factory function for creating Flush-Policies based on Record::timePoint member. More...
|
|
Flush-Policies determine if the Sink, they are attached to, shall flush its stream. They will be invoked after each handled Record and shall return true if a flush should happen. After flushing the Sink will call the flushed() function, which Flush-Policies can then use to reset their internal state if necessary.
Users can use the provided Flush-Policy classes or create their own. Custom policies do not have to inherit from any base-class but must follow the interface defined by the FlushPolicyFor concept.
◆ AlwaysFlushPolicy
A Flush-Policy which returns always true.
◆ makeChannelFlushPolicyFor()
template<Record TRecord, std::predicate< const RecordChannel_t< TRecord > & > TUnaryPredicate>
constexpr auto sl::log::makeChannelFlushPolicyFor |
( |
TUnaryPredicate && |
predicate | ) |
|
|
constexpr |
Factory function for creating Flush-Policies based on Record::channel member.
- Template Parameters
-
TRecord | Concrete Record type on which to apply the projection |
TUnaryPredicate | Invokable type, which has to accept objects the actual Record::Channel_t type |
- Parameters
-
predicate | Predicate object |
- Returns
- Flush-Policy object
This is the preferable way creating a Flush-Policies based on the Record::channel member, because the predicate becomes strong checked via concept and therefore will provide much clearer feedback in cases of error, while creating such Flush-Policies objects manually will potentially result in harder to read error messages.
◆ makeMessageFlushPolicyFor()
template<Record TRecord, std::predicate< const RecordMessage_t< TRecord > & > TUnaryPredicate>
constexpr auto sl::log::makeMessageFlushPolicyFor |
( |
TUnaryPredicate && |
predicate | ) |
|
|
constexpr |
Factory function for creating Flush-Policies based on Record::message member.
- Template Parameters
-
TRecord | Concrete Record type on which to apply the projection |
TUnaryPredicate | Invokable type, which has to accept objects the actual Record::Message_t type |
- Parameters
-
predicate | Predicate object |
- Returns
- Flush-Policy object
This is the preferable way creating a Flush-Policies based on the Record::message member, because the predicate becomes strong checked via concept and therefore will provide much clearer feedback in cases of error, while creating such Flush-Policies objects manually will potentially result in harder to read error messages.
◆ makeSeverityFlushPolicyFor()
template<Record TRecord, std::predicate< const RecordSeverity_t< TRecord > & > TUnaryPredicate>
constexpr auto sl::log::makeSeverityFlushPolicyFor |
( |
TUnaryPredicate && |
predicate | ) |
|
|
constexpr |
Factory function for creating Flush-Policies based on Record::severity member.
- Template Parameters
-
TRecord | Concrete Record type on which to apply the projection |
TUnaryPredicate | Invokable type, which has to accept objects the actual Record::SeverityLevel_t type |
- Parameters
-
predicate | Predicate object |
- Returns
- Flush-Policy object
This is the preferable way creating a Flush-Policies based on the Record::severity member, because the predicate becomes strong checked via concept and therefore will provide much clearer feedback in cases of error, while creating such Flush-Policies objects manually will potentially result in harder to read error messages.
◆ makeTimePointFlushPolicyFor()
template<Record TRecord, std::predicate< const RecordTimePoint_t< TRecord > & > TUnaryPredicate>
constexpr auto sl::log::makeTimePointFlushPolicyFor |
( |
TUnaryPredicate && |
predicate | ) |
|
|
constexpr |
Factory function for creating Flush-Policies based on Record::timePoint member.
- Template Parameters
-
TRecord | Concrete Record type on which to apply the projection |
TUnaryPredicate | Invokable type, which has to accept objects the actual Record::TimePoint_t type |
- Parameters
-
predicate | Predicate object |
- Returns
- Flush-Policy object
This is the preferable way creating a Flush-Policies based on the Record::timePoint member, because the predicate becomes strong checked via concept and therefore will provide much clearer feedback in cases of error, while creating such Flush-Policies objects manually will potentially result in harder to read error messages.