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 49 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 97 of file Log.h.

◆ Predicate

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

Definition at line 52 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 71 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 902 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 912 of file Log.cpp.

◆ Log() [3/3]

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

Definition at line 922 of file Log.cpp.

◆ ~Log()

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

Definition at line 927 of file Log.cpp.

Member Function Documentation

◆ debug() [1/2]

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

Definition at line 974 of file Log.cpp.

◆ debug() [2/2]

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

Definition at line 966 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 876 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 827 of file Log.cpp.

◆ defaultMinimumPrintLevel()

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

Get default minimum print level.

Definition at line 807 of file Log.cpp.

◆ defaultPrintCallback()

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

Get default print callback.

Definition at line 854 of file Log.cpp.

◆ error() [1/2]

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

Definition at line 1033 of file Log.cpp.

◆ error() [2/2]

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

Definition at line 1025 of file Log.cpp.

◆ fatal() [1/2]

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

Definition at line 1054 of file Log.cpp.

◆ fatal() [2/2]

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

Definition at line 1044 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 871 of file Log.cpp.

◆ info() [1/2]

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

Definition at line 993 of file Log.cpp.

◆ info() [2/2]

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

Definition at line 985 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 822 of file Log.cpp.

◆ minimumPrintLevel()

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

Get current minimum print level.

Definition at line 802 of file Log.cpp.

◆ printCallback()

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

Get current print callback.

Definition at line 849 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 864 of file Log.cpp.

◆ setLogCallback()

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

Definition at line 838 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 815 of file Log.cpp.

◆ setMinimumPrintLevel()

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

Set current minimum print level.

Definition at line 797 of file Log.cpp.

◆ setPrintCallback()

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

Set current print callback.

Definition at line 844 of file Log.cpp.

◆ trace() [1/2]

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

Definition at line 954 of file Log.cpp.

◆ trace() [2/2]

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

Definition at line 946 of file Log.cpp.

◆ warning() [1/2]

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

Definition at line 1013 of file Log.cpp.

◆ warning() [2/2]

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

Definition at line 1005 of file Log.cpp.


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