![]() |
Scene Fusion 2 API Reference
|
#include <Log.h>
Public Member Functions | |
EXTERNAL void | RegisterCallback (const std::string &channel, LogHandler handler, uint8_t levels, bool allowBubbling) |
EXTERNAL void | UnregisterCallback (const std::string &channel, LogHandler handler) |
EXTERNAL void | Write (const std::string &message, const std::string &channel, LogLevel level) |
Static Public Member Functions | |
static EXTERNAL std::shared_ptr< Log > | Instance () |
static EXTERNAL void | SetInstance (std::shared_ptr< Log > logPtr) |
static EXTERNAL void | Debug (const std::string &message, const std::string &channel="Root") |
static EXTERNAL void | Info (const std::string &message, const std::string &channel="Root") |
static EXTERNAL void | Warning (const std::string &message, const std::string &channel="Root") |
static EXTERNAL void | Error (const std::string &message, const std::string &channel="Root") |
static EXTERNAL void | Fatal (const std::string &message, const std::string &channel="Root") |
static EXTERNAL std::string | GetLevelString (LogLevel logLevel) |
static EXTERNAL std::string | GetTimeString () |
Static logger class. Log messages have a level and a channel string that can be used to filter log messages. Channels can have parent channels. Any message a channel receives will also be sent to all of it's parent channels. Channels are seperated by ".", with children channel following parents. All channels are children of the root channel. Example: KS::Log::Info("X.Y", "This message will be received by channels 'X.Y', 'X', and 'Root');
|
static |
Write a DEBUG log message
const | std::string& message to log |
const | std::string& channel to log to |
|
static |
Write an ERROR log message
const | std::string& message to log |
const | std::string& channel to log to |
|
static |
Write a fatal log message
const | std::string& message to log |
const | std::string& channel to log to |
|
static |
Get text for a logging level
LogLevel | logLevel |
|
static |
Get a time string YYYY-MM-DD hh:mm:ss for the current time.
|
static |
Write an INFO log message
const | std::string& message to log. |
const | std::string& channel to log to |
|
static |
Create or return a pointer to the log object
EXTERNAL void KS::Log::RegisterCallback | ( | const std::string & | channel, |
LogHandler | handler, | ||
uint8_t | levels, | ||
bool | allowBubbling | ||
) |
Register a log handler for a specific channel and log level
const | std::string& channel |
LogHandler | log handler |
LogLevel | log level |
bool | allowBubbling - if false, logs handled by this handler will not be processed by handlers on parent channels. |
|
static |
Assign the static instance to a specific log
std::shared_ptr<Log> |
EXTERNAL void KS::Log::UnregisterCallback | ( | const std::string & | channel, |
LogHandler | handler | ||
) |
Unregister a log handler for a specific channel and log level
const | std::string& channel |
LogHandler | log handler |
|
static |
Write a WARNING log message
const | std::string& message to log |
const | std::string& channel to log to |
EXTERNAL void KS::Log::Write | ( | const std::string & | message, |
const std::string & | channel, | ||
LogLevel | level | ||
) |
Parses a channel into a channel hierarchy (See above) and calls the handlers for each level starting with the lowest level and working up the hierarchy until 'Root'. If a handler has been registered with 'allowBubbling' set to false then all parent handlers will be skipped.
const | std::string& message |
const | std::string& channel |
LogLevel | log level |