FreeRDP-WebConnect WebSockets gateway
1.0.0.167
|
A logging class, mapping syslog(3) functionality to C++ on Unix systems. More...
#include <logging.hpp>
Public Types | |
enum | Facility { AUTH, AUTHPRIV, CRON, DAEMON, FTP, KERN, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7, LPR, MAIL, NEWS, SYSLOG, USER, UUCP } |
The predefined facilities. |
Public Member Functions | |
logger (const std::string &ident, const Facility facility=DAEMON, const std::string &mask="11111111") | |
Initializes logging. | |
logger (const logger &other) | |
Copy constructor. | |
logger & | operator= (const logger &other) |
Assignment operator. | |
void | setmask (std::bitset< 8 >mask) |
Modifies the set of enabled log levels. | |
void | setmaskByName (const std::string &names) |
Modifies the set of enabled log levels. | |
void | setfacility (Facility facility) |
Modifies the log facility. | |
void | setfacilityByName (const std::string &facility) |
Modifies the log facility. |
Static Public Member Functions | |
static void | release () |
Releases the internal log buffers. | |
static void | enable () |
Enables logging on all existing log channels. | |
static void | disable () |
Disables logging on all existing log channels. |
Static Public Attributes | |
static std::ostream | debug |
Stream for logging with log level LOG_DEBUG. | |
static std::ostream | info |
Stream for logging with log level LOG_INFO. | |
static std::ostream | notice |
Stream for logging with log level LOG_NOTICE. | |
static std::ostream | warn |
Stream for logging with log level LOG_WARNING. | |
static std::ostream | err |
Stream for logging with log level LOG_ERR. | |
static std::ostream | crit |
Stream for logging with log level LOG_CRIT. | |
static std::ostream | alert |
Stream for logging with log level LOG_ALERT. | |
static std::ostream | emerg |
Stream for logging with log level LOG_EMERG. |
A logging class, mapping syslog(3) functionality to C++ on Unix systems.
On Windows systems, the logging is performed via the application event log (all log levels, except LOG_DEBUG) and via OutputDebugString (for log level LOG_DEBUG). For every log level, a corresponding ostream exists.
Definition at line 36 of file logging.hpp.
wsgate::logger::logger | ( | const std::string & | ident, |
const Facility | facility = DAEMON , |
||
const std::string & | mask = "11111111" |
||
) |
Initializes logging.
ident | The program identifier. On Windows systems, this parameter defines the name of the EventSource in the application log. Additional note for Windows: In order to create proper entries in the application event log, a registry key with the supplied name is created below HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\ this key is not automatically deleted, since it's content points to the executable (or dll) which is using this class. Therefore, in your uninstaller, please remove that key. |
facility | The log facility to use. Ignored on Windows. |
mask | A string, specifying which log levels are enabled. This string can be specified in multiple formats:
|
void wsgate::logger::setfacility | ( | Facility | facility | ) |
Modifies the log facility.
This method has no effect on Windows.
facility | The log facility to use |
void wsgate::logger::setfacilityByName | ( | const std::string & | facility | ) |
Modifies the log facility.
This method has no effect on Windows.
facility | A string containg the facility name. |
void wsgate::logger::setmask | ( | std::bitset< 8 > | mask | ) |
Modifies the set of enabled log levels.
mask | A std::bitset of length 8. The leftmost bit is accociated with the LOG_DEBUG level, the next bit with LOG_INFO and so on. |
void wsgate::logger::setmaskByName | ( | const std::string & | names | ) |
Modifies the set of enabled log levels.
names | A string of log level names (all uppercase). Log level names can be DEBUG, INFO, NOTICE, WARNING, ERR, CRIT, ALERT and EMERG. |
|
static |
Stream for logging with log level LOG_ALERT.
On Windows, the message is tagged with an Error-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 202 of file logging.hpp.
|
static |
Stream for logging with log level LOG_CRIT.
On Windows, the message is tagged with an Error-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 193 of file logging.hpp.
|
static |
Stream for logging with log level LOG_DEBUG.
Writing to this stream before invokation of the constructor does nothing. On Windows, output is done via OutputDebugString and can be examined by tools like DebugView.
Definition at line 148 of file logging.hpp.
|
static |
Stream for logging with log level LOG_EMERG.
Writing to this stream before invokation On Windows, the message is tagged with an Error-Icon in the application event log. of the constructor does nothing.
Definition at line 211 of file logging.hpp.
|
static |
Stream for logging with log level LOG_ERR.
On Windows, the message is tagged with an Error-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 184 of file logging.hpp.
|
static |
Stream for logging with log level LOG_INFO.
On Windows, the message is tagged with an Info-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 157 of file logging.hpp.
|
static |
Stream for logging with log level LOG_NOTICE.
On Windows, the message is tagged with an Info-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 166 of file logging.hpp.
|
static |
Stream for logging with log level LOG_WARNING.
On Windows, the message is tagged with a Warning-Icon in the application event log. Writing to this stream before invokation of the constructor does nothing.
Definition at line 175 of file logging.hpp.