|
RTC Toolkit 6.0.0
|
Logging Facilities. More...
Files | |
| file | logger.hpp |
| Logging Support Library based on log4cplus. | |
| file | logger.cpp |
| Implementation of the logging methods. | |
Classes | |
| class | rtctk::componentFramework::LogInitializer |
| RAII class to clean-up logging without leaking memory. More... | |
Functions | |
| void | rtctk::componentFramework::LogConfigure (const std::string &app_name, const std::string &props_file_name) |
| Performs custom logging configuration for any application. | |
| void | rtctk::componentFramework::LogConfigure (const std::string &app_name, log4cplus::LogLevel default_log_level=log4cplus::INFO_LOG_LEVEL) |
| Performs default logging configuration for RTC Component applications. | |
| void | rtctk::componentFramework::LogConfigureTool (const std::string &app_name, log4cplus::LogLevel default_log_level=log4cplus::ERROR_LOG_LEVEL, bool log_to_file=false) |
| Performs default logging configuration for Client Applications and Standalone Tools. | |
| log4cplus::Logger & | rtctk::componentFramework::GetLogger (const std::string &name="app") |
| Get handle to a specific logger. | |
Logging Facilities.
| log4cplus::Logger & rtctk::componentFramework::GetLogger | ( | const std::string & | name = "app" | ) |
Get handle to a specific logger.
This is used all over the place together with the log4cplus logging macros.
The default logger is retrieved when calling GetLogger() without any further arguments
Instrument RTC developers are supposed to either use:
The RTC Toolkit will use a different logger hierarchy, namely:
| name | optional: name of the requested logger |
| void rtctk::componentFramework::LogConfigure | ( | const std::string & | app_name, |
| const std::string & | props_file_name ) |
Performs custom logging configuration for any application.
If a log properties file is given, the system will be configured according to this file. When creating the log properties file, take into account that the RTC Tk code logs to a "rtctk" logger and the RTC application code is supposed to log to an "app" logger. So configure loggers and appenders accordingly in your custom properties file. At a minimum, specify the "root" logger level and an appender for the root logger.
| app_name | component instance name or name of application (if not an RTC component) |
| props_file_name | pathname of log4cplus properties file |
| void rtctk::componentFramework::LogConfigure | ( | const std::string & | app_name, |
| log4cplus::LogLevel | default_log_level = log4cplus::INFO_LOG_LEVEL ) |
Performs default logging configuration for RTC Component applications.
This method is used on default by RTC Component applications and it configures logging programmatically using RTC Tk default settings.
This means:
| app_name | component instance name or name of application (if not an RTC component) |
| default_log_level | default log level |
| void rtctk::componentFramework::LogConfigureTool | ( | const std::string & | app_name, |
| log4cplus::LogLevel | default_log_level = log4cplus::ERROR_LOG_LEVEL, | ||
| bool | log_to_file = false ) |
Performs default logging configuration for Client Applications and Standalone Tools.
This method is used on default by Standalone Tools and Client Applications and it configures logging programmatically using RTC Tk default settings:
This means:
| app_name | component instance name or name of application (if not an RTC component) |
| default_log_level | default log level |
| log_to_file | option to write logs to syslog and human readable log files |