|
void | AddLoggerRef (FileWriter *fw) |
|
void | DelLoggerRef (FileWriter *fw) |
|
void | OpenFileLogs () |
|
void | CloseLogs () |
|
void | AddLogTypes (const std::string &type, LogStream *l, bool autoclose) |
|
bool | AddLogType (const std::string &type, LogStream *l, bool autoclose) |
|
void | DelLogStream (LogStream *l) |
|
bool | DelLogType (const std::string &type, LogStream *l) |
|
void | Log (const std::string &type, LogLevel loglevel, const std::string &msg) |
|
void | Log (const std::string &type, LogLevel loglevel, const char *fmt,...) CUSTOM_PRINTF(4 |
|
LogManager * | operator-> () |
|
◆ AddLoggerRef()
Adds a FileWriter instance to LogManager, or increments the reference count of an existing instance. Used for file-stream sharing for FileLogStreams.
◆ AddLogType()
bool LogManager::AddLogType |
( |
const std::string & |
type, |
|
|
LogStream * |
l, |
|
|
bool |
autoclose |
|
) |
| |
Registers a new logstream into the logging core, so it can be called for future events It is not a good idea to mix values of autoclose for the same LogStream.
- Parameters
-
type | The type to add this LogStream to. |
l | The LogStream to add. |
autoclose | True to have the LogStream automatically closed when all references to it are removed from LogManager. False to leave it open. |
- Returns
- True if the LogStream was added successfully, False otherwise.
◆ AddLogTypes()
void LogManager::AddLogTypes |
( |
const std::string & |
type, |
|
|
LogStream * |
l, |
|
|
bool |
autoclose |
|
) |
| |
Adds a single LogStream to multiple logtypes. This automatically handles things like "* -USERINPUT -USEROUTPUT" to mean all but USERINPUT and USEROUTPUT types. It is not a good idea to mix values of autoclose for the same LogStream.
- Parameters
-
type | The type string (from configuration, or whatever) to parse. |
l | The LogStream to add. |
autoclose | True to have the LogStream automatically closed when all references to it are removed from LogManager. False to leave it open. |
◆ CloseLogs()
void LogManager::CloseLogs |
( |
| ) |
|
Removes all LogStreams, meaning they have to be readded for logging to continue. Only LogStreams that were listed in AllLogStreams are actually closed.
◆ DelLoggerRef()
Indicates that a FileWriter reference has been removed. Reference count is decreased, and if zeroed, the FileWriter is closed.
◆ DelLogStream()
void LogManager::DelLogStream |
( |
LogStream * |
l | ) |
|
Removes a logstream from the core. After removal, it will not receive further events. If the LogStream was ever added with autoclose, it will be closed after this call (this means the pointer won't be valid anymore).
◆ DelLogType()
bool LogManager::DelLogType |
( |
const std::string & |
type, |
|
|
LogStream * |
l |
|
) |
| |
Removes a LogStream from a single type. If the LogStream has been registered for "*" it will still receive the type unless you remove it from "*" specifically. If the LogStream was added with autoclose set to true, then when the last occurrence of the stream is removed it will automatically be closed (freed).
◆ Log() [1/2]
void LogManager::Log |
( |
const std::string & |
type, |
|
|
LogLevel |
loglevel, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Logs an event, sending it to all LogStreams registered for the type.
- Parameters
-
type | Log message type (ex: "USERINPUT", "MODULE", ...) |
loglevel | Log message level (LOG_DEBUG, LOG_VERBOSE, LOG_DEFAULT, LOG_SPARSE, LOG_NONE) |
fmt | The format of the message to be logged. See your C manual on printf() for details. |
◆ Log() [2/2]
void LogManager::Log |
( |
const std::string & |
type, |
|
|
LogLevel |
loglevel, |
|
|
const std::string & |
msg |
|
) |
| |
Logs an event, sending it to all LogStreams registered for the type.
- Parameters
-
type | Log message type (ex: "USERINPUT", "MODULE", ...) |
loglevel | Log message level (LOG_DEBUG, LOG_VERBOSE, LOG_DEFAULT, LOG_SPARSE, LOG_NONE) |
msg | The message to be logged (literal). |
◆ OpenFileLogs()
void LogManager::OpenFileLogs |
( |
| ) |
|
Opens all logfiles defined in the configuration file using <log method="file">.
The documentation for this class was generated from the following files: