Viam C++ SDK current
|
Manages the logging infrastructure in the SDDK. More...
#include "log/logging.hpp"
Classes | |
struct | Filter |
Public Member Functions | |
void | set_global_resource_name (const std::string &name) |
Override the channel name of general log messages not originating from resources. | |
void | set_global_log_level (log_level) |
Set the global logger severity. | |
void | set_global_log_level (int argc, char **argv) |
Set the global logger severity from a command line argument vector. | |
void | set_resource_log_level (const std::string &resource, log_level) |
Set the logger severity for a resource. | |
LogSource & | global_logger () |
Return the SDK global log source. | |
Static Public Member Functions | |
static LogManager & | get () |
Returns the unique logger instance. | |
Friends | |
class | RobotClient |
class | Instance |
Manages the logging infrastructure in the SDDK.
Handles initialization and bookkeeping for logging infrastructure in the C++ SDK. This includes console logging, if active, and both global and resource-level log filtering.
|
static |
Returns the unique logger instance.
This is the only way to access the logger.
LogSource & viam::sdk::LogManager::global_logger | ( | ) |
Return the SDK global log source.
Users should prefer to log messages using the logging macros below.
void viam::sdk::LogManager::set_global_log_level | ( | int | argc, |
char ** | argv ) |
Set the global logger severity from a command line argument vector.
Sets severity to debug if "--log-level=debug" is the third argument. Sets severity to info otherwise. Useful for module implementations. See LogLevel documentation in the RDK for more information on how to start modules with a "log-level" commandline argument.
void viam::sdk::LogManager::set_resource_log_level | ( | const std::string & | resource, |
log_level | ) |
Set the logger severity for a resource.
LogManager can maintain separate severity levels for individual resources. For example, you may want to only report "error" messages for global logs and logs for one component of a modular resource, but enable verbose logging for a new component that is still being debugged.