Develop Biology
The language of life
|
#include <Engine.h>
Public Member Functions | |
Engine () | |
virtual | ~Engine () |
Level | FilterGet (Filter filter) const |
bool | FilterPass (Filter filter, Level level) const |
bool | FilterSet (Filter filter, Level level) |
bool | FilterSet (Name filter, Name level) |
void | Log (Filter filter, Level level, const char *format, va_list args) |
void | Log (Filter filter, Level level, const char *format,...) |
virtual void | Output (const std::string &logString)=0 |
Protected Attributes | |
std::ostringstream | m_logMessage |
log::Engines are responsible for printing logs. Create your own Engine, if you have your own output schema you'd like to use (e.g. to the screen of a gui instead of to a file or standard out).
bio::log::Engine::Engine | ( | ) |
Definition at line 37 of file Engine.cpp.
References bio::log::level::Info().
|
virtual |
Definition at line 45 of file Engine.cpp.
Level bio::log::Engine::FilterGet | ( | Filter | filter | ) | const |
filter |
Definition at line 135 of file Engine.cpp.
bool bio::log::Engine::FilterPass | ( | Filter | filter, |
Level | level | ||
) | const |
filter | |
level |
Definition at line 108 of file Engine.cpp.
Referenced by Log(), and bio::log::Writer::Log().
bool bio::log::Engine::FilterSet | ( | Filter | filter, |
Level | level | ||
) |
Change filter level for the filter
filter | what to affect; use ALL to set the level of all filters. |
level | value to set for the given filter (Log() calls must be >= to this to be seen). |
Definition at line 116 of file Engine.cpp.
Referenced by FilterSet().
Change filter level for the filter
filter | what to affect; use ALL to set the level of all filters. |
level | value to set for the given filter (Log() calls must be >= to this to be seen). |
Definition at line 125 of file Engine.cpp.
References FilterSet().
void bio::log::Engine::Log | ( | Filter | filter, |
Level | level, | ||
const char * | format, | ||
va_list | args | ||
) |
Generates a log string and calls Output (caller is responsible for using filters).
filter | |
level | |
format | |
args |
Definition at line 50 of file Engine.cpp.
References BIO_LOG_PRINTF_MAX_LINE_SIZE, BIO_SANITIZE_AT_SAFETY_LEVEL_2, FilterPass(), bio::physical::GetCurrentTimestamp(), m_logMessage, and Output().
Referenced by bio::log::Writer::ExternalLog(), Log(), and bio::log::Writer::Log().
void bio::log::Engine::Log | ( | Filter | filter, |
Level | level, | ||
const char * | format, | ||
... | |||
) |
Create a log string that will be Output(). *this can be invoked directly or via Writer::ExternalLog Both calls will have the same effect.
filter | |
level | |
format | |
... |
Definition at line 81 of file Engine.cpp.
References FilterPass(), and Log().
|
pure virtual |
Required override for outputting logs. logString will include a newline (
) character.
logString | fully prepared text to be logged. |
Referenced by Log().
|
protected |