This is a base class for connect specific loggers.
More...
#include <loggerbase.hpp>
|
| | LoggerBase (LogLevel &dynamicLogLevel, uint32_t &features) |
| | Dynamic log level. More...
|
| |
|
| static void | getLevelPrefix (LogLevel level, stringstream &ss) |
| | Retrieve a log level prefix. More...
|
| |
| static void | getLocation (string_view file, int line, stringstream &ss) |
| | Retrieves the location. More...
|
| |
| static string | getStrippedFilename (string_view file) |
| | retrieves a stripped filename without the path information. More...
|
| |
| static void | getThreadId (stringstream &ss) |
| | Retrieve thread identifier as string. More...
|
| |
| static void | getTimestamp (stringstream &ss) |
| | Retrieve the timetamp as string in iso format. More...
|
| |
This is a base class for connect specific loggers.
not to be used as is.
◆ anonymous enum
| Enumerator |
|---|
| FeatureTimestamp | Timestamp will be logged.
|
| FeatureLevel | Log level (INF, ERR, WRN etc will be logged).
|
| FeatureThreadId | Thread identifier will be logged.
|
| FeatureLocation | Logging location (file:linenumber) will be added to end ot the logrow.
|
| FeatureFilenameAsTag | Use plain filename (c:\temp\log.cpp -> [log]) as logging token.
|
◆ LoggerBase()
| kanzi::connect::LoggerBase::LoggerBase |
( |
LogLevel & |
dynamicLogLevel, |
|
|
uint32_t & |
features |
|
) |
| |
Dynamic log level.
- Parameters
-
| dynamicLogLevel | reference to variable that will hold the dynamic loglevel. |
◆ getLevelPrefix()
| static void kanzi::connect::LoggerBase::getLevelPrefix |
( |
LogLevel |
level, |
|
|
stringstream & |
ss |
|
) |
| |
|
staticprotected |
Retrieve a log level prefix.
- Parameters
-
| level | the log level |
| ss | will be appended with prefix. |
◆ getLocation()
| static void kanzi::connect::LoggerBase::getLocation |
( |
string_view |
file, |
|
|
int |
line, |
|
|
stringstream & |
ss |
|
) |
| |
|
staticprotected |
Retrieves the location.
- Parameters
-
| file | filename |
| line | line number of the logging. |
| ss | where to append the string. |
◆ getStrippedFilename()
| static string kanzi::connect::LoggerBase::getStrippedFilename |
( |
string_view |
file | ) |
|
|
staticprotected |
retrieves a stripped filename without the path information.
- Parameters
-
| file | the file with path and extension. |
- Returns
- stripped filename.
◆ getThreadId()
| static void kanzi::connect::LoggerBase::getThreadId |
( |
stringstream & |
ss | ) |
|
|
staticprotected |
Retrieve thread identifier as string.
- Parameters
-
| ss | will be appended with thread identifier. |
◆ getTimestamp()
| static void kanzi::connect::LoggerBase::getTimestamp |
( |
stringstream & |
ss | ) |
|
|
staticprotected |
Retrieve the timetamp as string in iso format.
- Parameters
-
| ss | will be appended the string in ISO format |
◆ levelEnabled()
| bool kanzi::connect::LoggerBase::levelEnabled |
( |
LogLevel |
level | ) |
const |
|
protected |
Is loglevel enabled and allowed to log.
- Returns
- true if enabled and allowed to log.
◆ m_dynamicLogLevel
| LogLevel& kanzi::connect::LoggerBase::m_dynamicLogLevel |
|
protected |
◆ m_features
| uint32_t& kanzi::connect::LoggerBase::m_features |
|
protected |
available features if any.
The documentation for this class was generated from the following file:
- connect/log/loggerbase.hpp