console_bridge_dev  master
It is a ROS-independent, pure CMake (i.e. non-catkin and non-rosbuild package) that provides logging calls that mirror those found in rosconsole, but for applications that are not necessarily using ROS.
Classes | Functions
console_bridge Namespace Reference

Message namespace. This contains classes needed to output error messages (or logging) from within the library. Message logging can be performed with logging macros. More...

Classes

class  OutputHandler
 Generic class to handle output from a piece of code. More...
 
class  OutputHandlerFile
 Implementation of OutputHandler that saves messages in a file. More...
 
class  OutputHandlerSTD
 Default implementation of OutputHandler. This sends the information to the console. More...
 

Functions

CONSOLE_BRIDGE_DLLAPI void noOutputHandler (void)
 This function instructs console bridge that no messages should be outputted. Equivalent to useOutputHandler(NULL) More...
 
CONSOLE_BRIDGE_DLLAPI void restorePreviousOutputHandler (void)
 Restore the output handler that was previously in use (if any) More...
 
CONSOLE_BRIDGE_DLLAPI void useOutputHandler (OutputHandler *oh)
 Specify the instance of the OutputHandler to use. By default, this is OutputHandlerSTD. More...
 
CONSOLE_BRIDGE_DLLAPI OutputHandlergetOutputHandler (void)
 Get the instance of the OutputHandler currently used. This is NULL in case there is no output handler. More...
 
CONSOLE_BRIDGE_DLLAPI void setLogLevel (LogLevel level)
 Set the minimum level of logging data to output. Messages with lower logging levels will not be recorded. More...
 
CONSOLE_BRIDGE_DLLAPI LogLevel getLogLevel (void)
 Retrieve the current level of logging data. Messages with lower logging levels will not be recorded. More...
 
CONSOLE_BRIDGE_DLLAPI void log (const char *file, int line, LogLevel level, const char *m,...)
 Root level logging function. This should not be invoked directly, but rather used via a logging macro. Formats the message string given the arguments and forwards the string to the output handler. More...
 

Detailed Description

Message namespace. This contains classes needed to output error messages (or logging) from within the library. Message logging can be performed with logging macros.

Function Documentation

◆ noOutputHandler()

CONSOLE_BRIDGE_DLLAPI void console_bridge::noOutputHandler ( void  )

This function instructs console bridge that no messages should be outputted. Equivalent to useOutputHandler(NULL)

◆ restorePreviousOutputHandler()

CONSOLE_BRIDGE_DLLAPI void console_bridge::restorePreviousOutputHandler ( void  )

Restore the output handler that was previously in use (if any)

◆ useOutputHandler()

CONSOLE_BRIDGE_DLLAPI void console_bridge::useOutputHandler ( OutputHandler oh)

Specify the instance of the OutputHandler to use. By default, this is OutputHandlerSTD.

◆ getOutputHandler()

CONSOLE_BRIDGE_DLLAPI OutputHandler* console_bridge::getOutputHandler ( void  )

Get the instance of the OutputHandler currently used. This is NULL in case there is no output handler.

◆ setLogLevel()

CONSOLE_BRIDGE_DLLAPI void console_bridge::setLogLevel ( LogLevel  level)

Set the minimum level of logging data to output. Messages with lower logging levels will not be recorded.

◆ getLogLevel()

CONSOLE_BRIDGE_DLLAPI LogLevel console_bridge::getLogLevel ( void  )

Retrieve the current level of logging data. Messages with lower logging levels will not be recorded.

◆ log()

CONSOLE_BRIDGE_DLLAPI void console_bridge::log ( const char *  file,
int  line,
LogLevel  level,
const char *  m,
  ... 
)

Root level logging function. This should not be invoked directly, but rather used via a logging macro. Formats the message string given the arguments and forwards the string to the output handler.