33 #include <ealogger/logmessage.h> 153 std::vector<ConversionPattern>
156 std::map<ealogger::constants::LOG_LEVEL, std::string>
std::mutex mtx_conv_pattern
Definition: sink.h:151
std::string datetime_pattern
Definition: sink.h:141
std::mutex mtx_enabled
Definition: sink.h:149
void set_min_lvl(ealogger::constants::LOG_LEVEL min_lvl)
Set minimum severity for this sink.
Definition: sink.cpp:63
bool get_enabled()
Check if this sink is enabled.
Definition: sink.cpp:57
std::mutex mtx_datetime_pattern
Definition: sink.h:148
Global ealogger constants.
Main namespace for ealogger.
Definition: conversion_pattern.h:28
Sink(std::string msg_template, std::string datetime_pattern, bool enabled, ealogger::constants::LOG_LEVEL min_lvl)
Sink constructor.
Definition: sink.cpp:21
void set_datetime_pattern(std::string datetime_pattern)
Set the date time conversion pattern.
Definition: sink.cpp:45
A sink is an object that writes the log message to a specific target.
Definition: sink.h:52
std::map< ealogger::constants::LOG_LEVEL, std::string > loglevel_lookup
Definition: sink.h:157
virtual void write_message(const std::string &msg)=0
Writes a LogMessage object to the logger sink.
void fill_conv_patterns(bool lock)
Fill Sink::vec_conv_patterns with ConverionPattern depending on Sink::msg_template.
Definition: sink.cpp:152
std::mutex mtx_msg_template
Definition: sink.h:147
std::vector< ConversionPattern > vec_conv_patterns
Definition: sink.h:154
bool enabled
Definition: sink.h:142
void set_msg_template(std::string msg_template)
Set the message template with conversion patterns.
Definition: sink.cpp:38
std::string msg_template
Definition: sink.h:140
virtual void config_changed()=0
This method will be called when the SinkConfig option changes.
Header with utility functions for ealogger.
void prepare_log_message(const std::shared_ptr< LogMessage > &log_message)
Prepare a log message before it is written to the targets.
Definition: sink.cpp:69
void set_enabled(bool enabled)
Enable or disable the sink.
Definition: sink.cpp:51
LOG_LEVEL
An enumaration representing the supported loglevels.
Definition: global.h:58
std::mutex mtx_min_lvl
Definition: sink.h:150
ealogger::constants::LOG_LEVEL min_level
Definition: sink.h:144