libfreenect2  0.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Logger Class Referenceabstract

Provide interfaces to receive log messages. More...

#include <libfreenect2/logger.h>

Public Types

enum  Level {
  None = 0, Error = 1, Warning = 2, Info = 3,
  Debug = 4
}
 Available levels of logging, higher is more output. More...
 

Public Member Functions

virtual ~Logger ()
 
virtual Level level () const
 Get the level of the logger; the level is immutable. More...
 
virtual void log (Level level, const std::string &message)=0
 libfreenect2 calls this function to output all log messages. More...
 

Static Public Member Functions

static Level getDefaultLevel ()
 Default is Info, or overridden by environment variable LIBFREENECT2_LOGGER_LEVEL. More...
 
static std::string level2str (Level level)
 Convert logging level to a human-readable name. More...
 

Protected Attributes

Level level_
 

Detailed Description

Provide interfaces to receive log messages.

You can inherit this class and implement your custom logger.

Member Enumeration Documentation

enum Level

Available levels of logging, higher is more output.

Enumerator
None 
Error 
Warning 
Info 
Debug 

Constructor & Destructor Documentation

virtual ~Logger ( )
virtual

Member Function Documentation

static Level getDefaultLevel ( )
static

Default is Info, or overridden by environment variable LIBFREENECT2_LOGGER_LEVEL.

LIBFREENECT2_LOGGER_LEVEL can contain a case-insensitive name of level.

static std::string level2str ( Level  level)
static

Convert logging level to a human-readable name.

virtual Level level ( ) const
virtual

Get the level of the logger; the level is immutable.

virtual void log ( Level  level,
const std::string &  message 
)
pure virtual

libfreenect2 calls this function to output all log messages.

Member Data Documentation

Level level_
protected