YARP
Yet Another Robot Platform
Logger.h File Reference
#include <yarp/conf/api.h>
#include <yarp/conf/system.h>
#include <string>
#include <yarp/os/Log.h>
#include <yarp/os/impl/PlatformStdio.h>
+ Include dependency graph for Logger.h:

Go to the source code of this file.

Classes

class  yarp::os::impl::Logger
 This is a wrapper for message logging. More...
 

Namespaces

 yarp
 The main, catch-all namespace for YARP.
 
 yarp::os
 An interface to the operating system, including Port based communication.
 
 yarp::os::impl
 The components from which ports and connections are built.
 

Macros

#define YARP_LM_DEBUG   04
 
#define YARP_LM_INFO   010
 
#define YARP_LM_WARNING   040
 
#define YARP_LM_ERROR   0200
 
#define YARP_ERROR(log, x)   ((yarp::os::impl::Logger*)&(log))->internal_error(x)
 
#define YARP_WARN(log, x)   ((yarp::os::impl::Logger*)&(log))->internal_warning(x)
 
#define YARP_INFO(log, x)   ((yarp::os::impl::Logger*)&(log))->internal_info(x)
 
#define YARP_DEBUG(log, x)   ((yarp::os::impl::Logger*)&(log))->internal_debug(x)
 
#define YARP_FAIL(log, x)   ((yarp::os::impl::Logger*)&(log))->internal_fail(x)
 
#define YARP_LONGEST_MESSAGE   1000
 
#define YARP_SPRINTF0(log, mode, msg)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg); (log).internal_ ## mode(&(_yarp_buf[0])); }
 
#define YARP_SPRINTF1(log, mode, msg, a)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a); (log).internal_ ## mode(&(_yarp_buf[0])); }
 
#define YARP_SPRINTF2(log, mode, msg, a, b)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b); (log).internal_ ## mode(&(_yarp_buf[0])); }
 
#define YARP_SPRINTF3(log, mode, msg, a, b, c)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c); (log).internal_ ## mode(&(_yarp_buf[0])); }
 
#define YARP_SPRINTF4(log, mode, msg, a, b, c, d)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c, d); (log).internal_ ## mode(&(_yarp_buf[0])); }
 
#define YARP_SPRINTF5(log, mode, msg, a, b, c, d, e)   { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c, d, e); (log).internal_ ## mode(&(_yarp_buf[0])); }
 

Macro Definition Documentation

◆ YARP_DEBUG

#define YARP_DEBUG (   log,
 
)    ((yarp::os::impl::Logger*)&(log))->internal_debug(x)

Definition at line 88 of file Logger.h.

◆ YARP_ERROR

#define YARP_ERROR (   log,
 
)    ((yarp::os::impl::Logger*)&(log))->internal_error(x)

Definition at line 84 of file Logger.h.

◆ YARP_FAIL

#define YARP_FAIL (   log,
 
)    ((yarp::os::impl::Logger*)&(log))->internal_fail(x)

Definition at line 92 of file Logger.h.

◆ YARP_INFO

#define YARP_INFO (   log,
 
)    ((yarp::os::impl::Logger*)&(log))->internal_info(x)

Definition at line 86 of file Logger.h.

◆ YARP_LM_DEBUG

#define YARP_LM_DEBUG   04

Definition at line 19 of file Logger.h.

◆ YARP_LM_ERROR

#define YARP_LM_ERROR   0200

Definition at line 22 of file Logger.h.

◆ YARP_LM_INFO

#define YARP_LM_INFO   010

Definition at line 20 of file Logger.h.

◆ YARP_LM_WARNING

#define YARP_LM_WARNING   040

Definition at line 21 of file Logger.h.

◆ YARP_LONGEST_MESSAGE

#define YARP_LONGEST_MESSAGE   1000

Definition at line 94 of file Logger.h.

◆ YARP_SPRINTF0

#define YARP_SPRINTF0 (   log,
  mode,
  msg 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 95 of file Logger.h.

◆ YARP_SPRINTF1

#define YARP_SPRINTF1 (   log,
  mode,
  msg,
 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 96 of file Logger.h.

◆ YARP_SPRINTF2

#define YARP_SPRINTF2 (   log,
  mode,
  msg,
  a,
 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 97 of file Logger.h.

◆ YARP_SPRINTF3

#define YARP_SPRINTF3 (   log,
  mode,
  msg,
  a,
  b,
 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 98 of file Logger.h.

◆ YARP_SPRINTF4

#define YARP_SPRINTF4 (   log,
  mode,
  msg,
  a,
  b,
  c,
 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c, d); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 99 of file Logger.h.

◆ YARP_SPRINTF5

#define YARP_SPRINTF5 (   log,
  mode,
  msg,
  a,
  b,
  c,
  d,
 
)    { char _yarp_buf[YARP_LONGEST_MESSAGE]; snprintf(&(_yarp_buf[0]), YARP_LONGEST_MESSAGE, msg, a, b, c, d, e); (log).internal_ ## mode(&(_yarp_buf[0])); }

Definition at line 100 of file Logger.h.

◆ YARP_WARN

#define YARP_WARN (   log,
 
)    ((yarp::os::impl::Logger*)&(log))->internal_warning(x)

Definition at line 85 of file Logger.h.