logrr_clog library
The logrr_clog
library provides the API for sending messages to the log.
The logrr_clog
library is intended for use in C-language programs. Use the logrr_cpp
library in C++ programs.
To get access to the API of this library:
Link your program to the library by using the target_link_libraries()
CMake command.
CMakeLists.txt
ClogLog() function and CLOG macro
The ClogLog()
function writes to the log.
The ClogLog()
function is intended for use in C-language programs. In C++ programs, use the Logger::Log() function or LOG_* macros.
A description of the ClogLog()
function and macros for quick access to it are provided in the file /opt/KasperskyOS-Community-Edition-<version>/sysroot-*-kos/include/component/logrr/clog/clog.h
.
component/logrr/clog/clog.h (fragment)
Parameters of the ClogLog()
function:
level
- Log level
LogrrLogLevel
. file
- File name.
line
- Number of the line in the file.
func
- Function name.
message
- Message text or message text formatting string.
...
- Parameters to be inserted into the
message
formatting string.
Macro for quick access to the ClogLog() function
Instead of calling the ClogLog()
function, you can use the macro whose description is provided in the file component/logrr/clog/clog.h
. This macros is variadic (takes a variable number of parameters), which lets you avoid specifying all parameters of the ClogLog()
function. When calling this macro, you only need to specify the log level and message text or the message formatting string with the values of parameters. The applied log level
is determined by the first parameter of the macro. An example of using this macro is provided in the section titled Using macros to send messages to a log.
LogrrLogLevel enumerated type
The enumerated type LogrrLogLevel
contains fields whose names correspond to the log levels available in the LogRR
program.
The enumerated type LogrrLogLevel
is intended for use in C-language programs. In C++ programs, use the LogLevel
class.
LogrrLogLevel
enumerators can be passed to the ClogLog()
function to send a message with the specified log level.
A description of LogrrLogLevel
enumeration is provided in the file /opt/KasperskyOS-Community-Edition-<version>/sysroot-*-kos/include/component/logrr/core/log_level_c.h
.
component/logrr/core/log_level_c.h (fragment)