#include <SysLogEngine.h>
Public Member Functions | |
void | saveMessage (const Logger::UMessage &message) override |
SysLogEngine (const String &programName, uint32_t facilities=LOG_USER) | |
~SysLogEngine () override | |
void | getOptions (uint32_t &options, String &programName, uint32_t &facilities) const |
Public Member Functions inherited from sptk::LogEngine | |
virtual void | saveMessage (const Logger::UMessage &message)=0 |
LogEngine (const String &logEngineName) | |
~LogEngine () noexcept override | |
virtual void | reset () |
void | options (int ops) |
size_t | options () const |
void | option (int options, bool flag) |
void | priority (LogPriority prt) |
virtual void | minPriority (LogPriority prt) |
virtual LogPriority | minPriority () const |
Public Member Functions inherited from sptk::Thread | |
Thread (const String &name, const std::shared_ptr< ThreadManager > &threadManager=nullptr) | |
virtual | ~Thread () |
virtual void | run () |
bool | running () const |
virtual void | threadFunction ()=0 |
virtual void | terminate () |
virtual void | onThreadExit () |
virtual bool | terminated () |
virtual void | join () |
Id | id () const |
const String & | name () const |
virtual bool | sleep_for (std::chrono::milliseconds interval) |
virtual bool | sleep_until (const DateTime ×tamp) |
Additional Inherited Members | |
Public Types inherited from sptk::Thread | |
using | Id = std::thread::id |
Static Public Member Functions inherited from sptk::LogEngine | |
static String | priorityName (LogPriority prt) |
static LogPriority | priorityFromName (const String &prt) |
Protected Member Functions inherited from sptk::LogEngine | |
void | threadFunction () override |
void | log (Logger::UMessage &message) |
void | shutdown () noexcept |
A log stored in the system log.
On *nix , the log is sent to *nix syslog daemon. On Windows NT/2000+/XP the log is sent to Event Log (Application). On Windows 95/98/ME the system log isn't supported.. The facility method allows to define - which system log is used
sptk::SysLogEngine::SysLogEngine | ( | const String & | programName, |
uint32_t | facilities = LOG_USER |
||
) |
Constructor
Creates a new log object based on the syslog facility (or facilities). For Windows, parameter facilities is ignored and messages are stored into Application event log. The program name is optional. It is set for all the SysLogEngine objects at once. If set, it appears in the log as a message prefix. Every time the program name is changed, the log is closed to be re-opened on next message.
programName | Program name |
facilities | Log facility or a set of facilities. |
|
override |
Destructor
Destructs the log object, closes the log descriptor, releases all the allocated resources
void sptk::SysLogEngine::getOptions | ( | uint32_t & | options, |
String & | programName, | ||
uint32_t & | facilities | ||
) | const |
Get log engine options
options | Log engine output options |
programName | Log engine program name |
facilities | Log engine facilities |
|
overridevirtual |
Stores or sends log message to actual destination
This method should be overwritten by the actual log implementation
message | Log message |
Implements sptk::LogEngine.