YARP
Yet Another Robot Platform
yarp::os::Log Class Reference

#include <yarp/os/Log.h>

Public Types

enum  LogType : uint8_t {
  LogTypeUnknown = 0,
  TraceType,
  DebugType,
  InfoType,
  WarningType,
  ErrorType,
  FatalType,
  LogTypeReserved = 0xFF
}
 
using Predicate = bool(*)()
 
using LogCallback = void(*)(yarp::os::Log::LogType type, const char *msg, const char *file, const unsigned int line, const char *func, double systemtime, double networktime, double externaltime, const char *comp_name)
 

Public Member Functions

 Log (const char *file, const unsigned int line, const char *func, const Predicate pred=nullptr, const LogComponent &comp=defaultLogComponent())
 
 Log (const char *file, const unsigned int line, const char *func, const double externaltime, const Predicate pred=nullptr, const LogComponent &comp=defaultLogComponent())
 
 Log ()
 
virtual ~Log ()
 
void trace (const char *msg,...) const
 
void debug (const char *msg,...) const
 
void info (const char *msg,...) const
 
void warning (const char *msg,...) const
 
void error (const char *msg,...) const
 
void fatal (const char *msg,...) const
 
LogStream trace () const
 
LogStream debug () const
 
LogStream info () const
 
LogStream warning () const
 
LogStream error () const
 
LogStream fatal () const
 

Static Public Member Functions

static void setLogCallback (LogCallback)
 
static void setMinimumPrintLevel (LogType level)
 Set current minimum print level. More...
 
static LogType minimumPrintLevel ()
 Get current minimum print level. More...
 
static LogType defaultMinimumPrintLevel ()
 Get default minimum print level. More...
 
static void setMinimumForwardLevel (LogType level)
 Set current minimum forward level (it does nothing if forwarding is not enabled) More...
 
static LogType minimumForwardLevel ()
 Get current minimum forward level (or LogTypeReserved if forwarding is not enabled) More...
 
static LogType defaultMinimumForwardLevel ()
 Get default minimum forward level (or LogTypeReserved if forwarding is not enabled) More...
 
static void setPrintCallback (LogCallback)
 Set current print callback. More...
 
static LogCallback printCallback ()
 Get current print callback. More...
 
static LogCallback defaultPrintCallback ()
 Get default print callback. More...
 
static void setForwardCallback (LogCallback)
 Set current forward callback (it does nothing if forwarding is not enabled) More...
 
static LogCallback forwardCallback ()
 Get current forward callback (or nullptr if forwarding is not enabled) More...
 
static LogCallback defaultForwardCallback ()
 Get default forward callback (or nullptr if forwarding is not enabled) More...
 

Detailed Description

Definition at line 52 of file Log.h.

Member Typedef Documentation

◆ LogCallback

using yarp::os::Log::LogCallback = void (*)(yarp::os::Log::LogType type, const char* msg, const char* file, const unsigned int line, const char* func, double systemtime, double networktime, double externaltime, const char* comp_name)

Definition at line 100 of file Log.h.

◆ Predicate

using yarp::os::Log::Predicate = bool(*)()

Definition at line 55 of file Log.h.

Member Enumeration Documentation

◆ LogType

enum yarp::os::Log::LogType : uint8_t
Enumerator
LogTypeUnknown 
TraceType 
DebugType 
InfoType 
WarningType 
ErrorType 
FatalType 
LogTypeReserved 

Definition at line 74 of file Log.h.

Constructor & Destructor Documentation

◆ Log() [1/3]

yarp::os::Log::Log ( const char *  file,
const unsigned int  line,
const char *  func,
const Predicate  pred = nullptr,
const LogComponent comp = defaultLogComponent() 
)

Definition at line 905 of file Log.cpp.

◆ Log() [2/3]

yarp::os::Log::Log ( const char *  file,
const unsigned int  line,
const char *  func,
const double  externaltime,
const Predicate  pred = nullptr,
const LogComponent comp = defaultLogComponent() 
)

Definition at line 915 of file Log.cpp.

◆ Log() [3/3]

yarp::os::Log::Log ( )

Definition at line 925 of file Log.cpp.

◆ ~Log()

yarp::os::Log::~Log ( )
virtual

Definition at line 930 of file Log.cpp.

Member Function Documentation

◆ debug() [1/2]

yarp::os::LogStream yarp::os::Log::debug ( ) const

Definition at line 977 of file Log.cpp.

◆ debug() [2/2]

void yarp::os::Log::debug ( const char *  msg,
  ... 
) const

Definition at line 969 of file Log.cpp.

◆ defaultForwardCallback()

yarp::os::Log::LogCallback yarp::os::Log::defaultForwardCallback ( )
static

Get default forward callback (or nullptr if forwarding is not enabled)

Definition at line 879 of file Log.cpp.

◆ defaultMinimumForwardLevel()

yarp::os::Log::LogType yarp::os::Log::defaultMinimumForwardLevel ( )
static

Get default minimum forward level (or LogTypeReserved if forwarding is not enabled)

Definition at line 830 of file Log.cpp.

◆ defaultMinimumPrintLevel()

yarp::os::Log::LogType yarp::os::Log::defaultMinimumPrintLevel ( )
static

Get default minimum print level.

Definition at line 810 of file Log.cpp.

◆ defaultPrintCallback()

yarp::os::Log::LogCallback yarp::os::Log::defaultPrintCallback ( )
static

Get default print callback.

Definition at line 857 of file Log.cpp.

◆ error() [1/2]

yarp::os::LogStream yarp::os::Log::error ( ) const

Definition at line 1036 of file Log.cpp.

◆ error() [2/2]

void yarp::os::Log::error ( const char *  msg,
  ... 
) const

Definition at line 1028 of file Log.cpp.

◆ fatal() [1/2]

yarp::os::LogStream yarp::os::Log::fatal ( ) const

Definition at line 1057 of file Log.cpp.

◆ fatal() [2/2]

void yarp::os::Log::fatal ( const char *  msg,
  ... 
) const

Definition at line 1047 of file Log.cpp.

◆ forwardCallback()

yarp::os::Log::LogCallback yarp::os::Log::forwardCallback ( )
static

Get current forward callback (or nullptr if forwarding is not enabled)

Definition at line 874 of file Log.cpp.

◆ info() [1/2]

yarp::os::LogStream yarp::os::Log::info ( ) const

Definition at line 996 of file Log.cpp.

◆ info() [2/2]

void yarp::os::Log::info ( const char *  msg,
  ... 
) const

Definition at line 988 of file Log.cpp.

◆ minimumForwardLevel()

yarp::os::Log::LogType yarp::os::Log::minimumForwardLevel ( )
static

Get current minimum forward level (or LogTypeReserved if forwarding is not enabled)

Definition at line 825 of file Log.cpp.

◆ minimumPrintLevel()

yarp::os::Log::LogType yarp::os::Log::minimumPrintLevel ( )
static

Get current minimum print level.

Definition at line 805 of file Log.cpp.

◆ printCallback()

yarp::os::Log::LogCallback yarp::os::Log::printCallback ( )
static

Get current print callback.

Definition at line 852 of file Log.cpp.

◆ setForwardCallback()

void yarp::os::Log::setForwardCallback ( LogCallback  cb)
static

Set current forward callback (it does nothing if forwarding is not enabled)

Definition at line 867 of file Log.cpp.

◆ setLogCallback()

void yarp::os::Log::setLogCallback ( LogCallback  cb)
static

Definition at line 841 of file Log.cpp.

◆ setMinimumForwardLevel()

void yarp::os::Log::setMinimumForwardLevel ( LogType  level)
static

Set current minimum forward level (it does nothing if forwarding is not enabled)

Definition at line 818 of file Log.cpp.

◆ setMinimumPrintLevel()

void yarp::os::Log::setMinimumPrintLevel ( LogType  level)
static

Set current minimum print level.

Definition at line 800 of file Log.cpp.

◆ setPrintCallback()

void yarp::os::Log::setPrintCallback ( LogCallback  cb)
static

Set current print callback.

Definition at line 847 of file Log.cpp.

◆ trace() [1/2]

yarp::os::LogStream yarp::os::Log::trace ( ) const

Definition at line 957 of file Log.cpp.

◆ trace() [2/2]

void yarp::os::Log::trace ( const char *  msg,
  ... 
) const

Definition at line 949 of file Log.cpp.

◆ warning() [1/2]

yarp::os::LogStream yarp::os::Log::warning ( ) const

Definition at line 1016 of file Log.cpp.

◆ warning() [2/2]

void yarp::os::Log::warning ( const char *  msg,
  ... 
) const

Definition at line 1008 of file Log.cpp.


The documentation for this class was generated from the following files: