A namespace for logging utilities.
Name | |
---|---|
class | AclLog::CommandLogFormatter This class is used to format log entries for Rendering Engine commands. |
class | AclLog::ThreadNameFormatterFlag |
class | AclLog::FileLocationFormatterFlag A custom flag formatter which logs the source file location between a par of “[]”, in case the location is provided with the log call. |
Name | |
---|---|
enum class | Level { kTrace, kDebug, kInfo, kWarning, kError, kCritical, kOff} Log levels. |
Name | |
---|---|
void | init(const std::string & name) Initialize logging. |
void | initCommandLog(const std::string & name) Init the Rendering Engine command log. |
void | setLevel(Level level) Set global logging level. |
void | logCommand(const std::string & origin, const std::string & command) Log a command to the command log. |
AclLog::Level | getLogLevel() Internal helper function for getting the setting for the log level. |
size_t | getMaxFileSize() Internal helper function for getting the setting for the maximum size for a log file. |
size_t | getMaxLogRotations() Internal helper function for getting the setting for the maximum number of rotated log files. |
std::filesystem::path | getLogFileFullPath(const std::string & name) Internal helper function for constructing the full path name for the log file. |
std::string | getThreadName() |
Enumerator | Value | Description |
---|---|---|
kTrace | ||
kDebug | ||
kInfo | ||
kWarning | ||
kError | ||
kCritical | ||
kOff |
Log levels.
void init(
const std::string & name
)
Initialize logging.
Parameters:
By default two sinks are created. The first sink writes messages to the console. The second sink attempts to create a log file in the path set by the environment variable ACL_LOG_PATH (’/tmp’ if unset). The name of the log file is ’name-
void initCommandLog(
const std::string & name
)
Init the Rendering Engine command log.
Parameters:
void setLevel(
Level level
)
Set global logging level.
Parameters:
void logCommand(
const std::string & origin,
const std::string & command
)
Log a command to the command log.
Parameters:
AclLog::Level getLogLevel()
Internal helper function for getting the setting for the log level.
Return: The wanted log level fetched from an environment variable if set, or else a default value
size_t getMaxFileSize()
Internal helper function for getting the setting for the maximum size for a log file.
Return: The wanted maximum size of the log file fetched from an environment variable if set, or else a default value
size_t getMaxLogRotations()
Internal helper function for getting the setting for the maximum number of rotated log files.
Return: The wanted number of log files to rotate fetched from an environment variable if set, or else a default value
std::filesystem::path getLogFileFullPath(
const std::string & name
)
Internal helper function for constructing the full path name for the log file.
Parameters:
Return: The full path to the log file
inline std::string getThreadName()
Updated on 2024-01-25 at 12:02:05 +0100