ealogger
ealogger is a c++ library that provides a blazing fast and easy to use logging mechanism
|
A conversion pattern for message templates. More...
#include <conversion_pattern.h>
Public Types | |
enum | PATTERN_TYPE { DT = 0, FILE, FILE_ABSOLUTE, LINE, FUNC, HOST, THREADID, MSG, LVL } |
Identifiers for patterns supported by ealogger. More... | |
Public Member Functions | |
ConversionPattern (std::string conv_pattern, const PATTERN_TYPE ptype) | |
Constructor for the a conversion pattern. More... | |
template<typename T > | |
void | replace_conversion_pattern (std::string &msg, T new_value) const |
Replace conversion pattern with new_value. More... | |
ConversionPattern::PATTERN_TYPE | get_pattern_type () const |
Get the conversion pattern type. More... | |
template<> | |
void | replace_conversion_pattern (std::string &msg, std::string new_value) const |
Replace conversion pattern with new_value. More... | |
A conversion pattern for message templates.
ealogger supports several conversion patterns that let you substitude a pattern within a string with an appropriate value. This way the style of the log messages can be set for each log sink. Currently we support these conversion patterns
d : Date Time as provided f : Name of the file from where a log message was issued F : Absolut path of a file as provided by FILE from where a log message was issued l : Line number of the file from where a log message was issued (LINE) u : Name of the function from where a log message was issued (func) h : Hostname t : Thread ID m : Log message s : Log level / severity
|
inline |
Constructor for the a conversion pattern.
conv_pattern | The conversion pattern |
ptype | conversion pattern identifier |
|
inline |
Get the conversion pattern type.
|
inline |
Replace conversion pattern with new_value.
msg | Message template reference |
new_value | Value to replace all occurences of the conversion pattern with |
|
inline |
Replace conversion pattern with new_value.
msg | The message pattern |
new_value | New value |
This method is a specialization of ConversionPattern::replace_conversion_pattern(std::string, T) Here the actual replacement of all occurences of the conversion pattern with a dedicated value takes place.