OpcUaCanOpen
CANopen OPC-UA server
|
Typedefs | |
typedef size_t | LogComponentHandle |
Enumerations | |
enum | LOG_LEVEL { TRC = 0, DBG, INF, WRN, ERR } |
Functions | |
SHARED_LIB_EXPORT_DEFN bool | initializeLogging (const Log::LOG_LEVEL &nonComponentLogLevel=Log::INF) |
Initializers: Logging can only be initialized ONCE! To try and avoid thread contention. More... | |
SHARED_LIB_EXPORT_DEFN bool | initializeDllLogging (LogItInstance *remoteLogInstance) |
initializer to be called when using LogIt inside a shared library. More... | |
SHARED_LIB_EXPORT_DEFN LogComponentHandle | registerLoggingComponent (const std::string &componentName, const Log::LOG_LEVEL &nonComponentLogLevel=Log::INF) |
register a user defined logging component. More... | |
SHARED_LIB_EXPORT_DEFN bool | isLoggable (const Log::LOG_LEVEL &level) |
log check: should message be logged? More... | |
SHARED_LIB_EXPORT_DEFN bool | isLoggable (const Log::LOG_LEVEL &level, const LogComponentHandle &componentHandle) |
SHARED_LIB_EXPORT_DEFN bool | isLoggable (const Log::LOG_LEVEL &level, const std::string &componentName) |
SHARED_LIB_EXPORT_DEFN void | setNonComponentLogLevel (const Log::LOG_LEVEL &level) |
Get/Set the log threshold for all LOG messages without a component specified, i.e. More... | |
SHARED_LIB_EXPORT_DEFN Log::LOG_LEVEL | getNonComponentLogLevel (void) |
SHARED_LIB_EXPORT_DEFN const std::map< Log::LogComponentHandle, std::string > | getComponentLogsList () |
Get/Set the log threshold for all LOG messages where a component is specified, i.e. More... | |
SHARED_LIB_EXPORT_DEFN bool | setComponentLogLevel (const LogComponentHandle &componentHandle, const LOG_LEVEL &level) |
SHARED_LIB_EXPORT_DEFN bool | getComponentLogLevel (const LogComponentHandle &componentHandle, LOG_LEVEL &level) |
SHARED_LIB_EXPORT_DEFN std::string | getComponentName (const LogComponentHandle &componentHandle) |
Finds the user defined string (specified in the registerLoggingComponent call) for a given componentHandle. More... | |
SHARED_LIB_EXPORT_DEFN LogComponentHandle | getComponentHandle (const std::string componentName) |
Finds the component handle for a given component name. More... | |
std::string | logLevelToString (const LOG_LEVEL &level) |
bool | logLevelFromString (const std::string &s, LOG_LEVEL &out) |
Variables | |
const size_t | g_sMaxComponentIdCount = 512 |
const LogComponentHandle | INVALID_HANDLE = 999999999 |
typedef size_t Log::LogComponentHandle |
Definition at line 35 of file LogItStaticDefinitions.h.
enum Log::LOG_LEVEL |
Enumerator | |
---|---|
TRC | |
DBG | |
INF | |
WRN | |
ERR |
Definition at line 29 of file LogLevels.h.
Log::LogComponentHandle Log::getComponentHandle | ( | const std::string | componentName | ) |
Finds the component handle for a given component name.
If there is no component registered with that name, returns Log::INVALID_HANDLE, otherwise returns the component handle.
bool Log::getComponentLogLevel | ( | const LogComponentHandle & | componentHandle, |
LOG_LEVEL & | level | ||
) |
const std::map< Log::LogComponentHandle, string > Log::getComponentLogsList | ( | ) |
Get/Set the log threshold for all LOG messages where a component is specified, i.e.
calls such as LOG(Log::INF, USER_DEFINED_COMPONENT_HANDLE_1) << "log message tagged with component id"
Note getComponentLogLevel returns false if componentHandle not registered.
string Log::getComponentName | ( | const LogComponentHandle & | componentHandle | ) |
Log::LOG_LEVEL Log::getNonComponentLogLevel | ( | void | ) |
bool Log::initializeDllLogging | ( | LogItInstance * | remoteLogInstance | ) |
initializer to be called when using LogIt inside a shared library.
The remoteLogInstance ptr should be supplied to the shared library from the main executable (note that this will probably require that the shared library API supports passing this ptr before the shared library can initialize the logger and start logging).
The ptr (in the main executable, to pass to the DLL) is available from LogItInstance::getInstance() after the exe calls LogIt::initialiseLogging().
bool Log::initializeLogging | ( | const Log::LOG_LEVEL & | nonComponentLogLevel = Log::INF | ) |
Initializers: Logging can only be initialized ONCE! To try and avoid thread contention.
Note: although logging is initialized once, logging thresholds (for non-component and component verbosity) can be set at any time (by any thread). Simple initializer, without component specific logging. Only LOG(LOG_LEVEL) invocations will be considered for logging, subject to logging verbosity threshold.
bool Log::isLoggable | ( | const Log::LOG_LEVEL & | level | ) |
bool Log::isLoggable | ( | const Log::LOG_LEVEL & | level, |
const LogComponentHandle & | componentHandle | ||
) |
bool Log::isLoggable | ( | const Log::LOG_LEVEL & | level, |
const std::string & | componentName | ||
) |
bool Log::logLevelFromString | ( | const std::string & | s, |
LOG_LEVEL & | out | ||
) |
Definition at line 40 of file LogLevels.cpp.
std::string Log::logLevelToString | ( | const LOG_LEVEL & | level | ) |
Definition at line 27 of file LogLevels.cpp.
SHARED_LIB_EXPORT_DEFN LogComponentHandle Log::registerLoggingComponent | ( | const std::string & | componentName, |
const Log::LOG_LEVEL & | nonComponentLogLevel = Log::INF |
||
) |
register a user defined logging component.
LOG(LOG_LEVEL) invocations will be considered for logging and LOG(LOG_LEVEL, USER_COMPONENT) i.e. calls for registered components, will be considered for logging, subject to threshold.
RETURNS: the logging component handle, or, in case of error, Log::INVALID_HANDLE
bool Log::setComponentLogLevel | ( | const LogComponentHandle & | componentHandle, |
const LOG_LEVEL & | level | ||
) |
void Log::setNonComponentLogLevel | ( | const Log::LOG_LEVEL & | level | ) |
Get/Set the log threshold for all LOG messages without a component specified, i.e.
calls such as LOG(Log::INF) << "general log message"
const size_t Log::g_sMaxComponentIdCount = 512 |
Definition at line 37 of file LogItStaticDefinitions.h.
const LogComponentHandle Log::INVALID_HANDLE = 999999999 |
Definition at line 38 of file LogItStaticDefinitions.h.