libplayercommon

This C library provides error-reporting and debug output facilities. More...

Detailed Description

This C library provides error-reporting and debug output facilities.

Instead of calling directly into the stdio library (printf, puts, etc.), use the macros defined in error.h, so that message verbosity can be centrally controlled and so that all messsages get logged to .player.

#define PLAYER_ERROR(msg)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n")
 
#define PLAYER_ERROR1(msg, a)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a)
 
#define PLAYER_ERROR2(msg, a, b)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b)
 
#define PLAYER_ERROR3(msg, a, b, c)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c)
 
#define PLAYER_ERROR4(msg, a, b, c, d)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c, d)
 
#define PLAYER_ERROR5(msg, a, b, c, d, e)   ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c, d, e)
 
#define PLAYER_WARN(msg)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n")
 Warning message macros.
 
#define PLAYER_WARN1(msg, a)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a)
 
#define PLAYER_WARN2(msg, a, b)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b)
 
#define PLAYER_WARN3(msg, a, b, c)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c)
 
#define PLAYER_WARN4(msg, a, b, c, d)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d)
 
#define PLAYER_WARN5(msg, a, b, c, d, e)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e)
 
#define PLAYER_WARN6(msg, a, b, c, d, e, f)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f)
 
#define PLAYER_WARN7(msg, a, b, c, d, e, f, g)   ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f, g)
 
#define PLAYER_MSG0(level, msg)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n")
 General messages. More...
 
#define PLAYER_MSG1(level, msg, a)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a)
 
#define PLAYER_MSG2(level, msg, a, b)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b)
 
#define PLAYER_MSG3(level, msg, a, b, c)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c)
 
#define PLAYER_MSG4(level, msg, a, b, c, d)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d)
 
#define PLAYER_MSG5(level, msg, a, b, c, d, e)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e)
 
#define PLAYER_MSG6(level, msg, a, b, c, d, e, f)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f)
 
#define PLAYER_MSG7(level, msg, a, b, c, d, e, f, g)   ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f, g)
 

Macro Definition Documentation

◆ PLAYER_ERROR

◆ PLAYER_ERROR1

#define PLAYER_ERROR1 (   msg,
 
)    ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a)

◆ PLAYER_ERROR2

#define PLAYER_ERROR2 (   msg,
  a,
 
)    ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b)

Error message macros

Referenced by Alsa::Main(), and SegwayRMP::ProcessMessage().

◆ PLAYER_ERROR3

#define PLAYER_ERROR3 (   msg,
  a,
  b,
 
)    ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c)

Error message macros

◆ PLAYER_ERROR4

#define PLAYER_ERROR4 (   msg,
  a,
  b,
  c,
 
)    ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c, d)

Error message macros

◆ PLAYER_ERROR5

#define PLAYER_ERROR5 (   msg,
  a,
  b,
  c,
  d,
 
)    ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c, d, e)

Error message macros

◆ PLAYER_MSG0

#define PLAYER_MSG0 (   level,
  msg 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n")

General messages.

Use level to indicate the message importance

  • 0 : important
  • 1 : informative
  • 2+ : diagnostic All messages are recorded in the log file, but only the more important messages are printed on the console. Use the command line option to dictate which messages will be printed.

Referenced by SegwayRMP::CanBusSetup(), snd::Main(), SegwayRMP::Main(), wbr914::Main(), SegwayRMP::MainQuit(), SegwayRMP400::MainQuit(), AdaptiveMCL::MainQuit(), SegwayRMP400::MainSetup(), AdaptiveMCL::MainSetup(), wbr914::MainSetup(), snd::ProcessMessage(), MapTransform::ProcessMessage(), RobotLocation::SetCurrentError(), snd::Setup(), snd::Shutdown(), and SegwayRMP::USBSetup().

◆ PLAYER_MSG1

#define PLAYER_MSG1 (   level,
  msg,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a)

◆ PLAYER_MSG2

#define PLAYER_MSG2 (   level,
  msg,
  a,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b)

Error message macros

Referenced by SegwayRMP::Main().

◆ PLAYER_MSG3

#define PLAYER_MSG3 (   level,
  msg,
  a,
  b,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c)

Error message macros

Referenced by snd::ProcessMessage(), and RobotLocation::SetCurrentError().

◆ PLAYER_MSG4

#define PLAYER_MSG4 (   level,
  msg,
  a,
  b,
  c,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d)

Error message macros

Referenced by MapTransform::ProcessMessage().

◆ PLAYER_MSG5

#define PLAYER_MSG5 (   level,
  msg,
  a,
  b,
  c,
  d,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e)

Error message macros

◆ PLAYER_MSG6

#define PLAYER_MSG6 (   level,
  msg,
  a,
  b,
  c,
  d,
  e,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f)

Error message macros

◆ PLAYER_MSG7

#define PLAYER_MSG7 (   level,
  msg,
  a,
  b,
  c,
  d,
  e,
  f,
 
)    ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f, g)

Error message macros

Referenced by RobotLocation::SetCurrentError().

◆ PLAYER_WARN1

#define PLAYER_WARN1 (   msg,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a)

Error message macros

Referenced by Alsa::Main(), and snd::ProcessMessage().

◆ PLAYER_WARN2

#define PLAYER_WARN2 (   msg,
  a,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b)

Error message macros

Referenced by MapTransform::ProcessMessage(), and SegwayRMP::UpdateData().

◆ PLAYER_WARN3

#define PLAYER_WARN3 (   msg,
  a,
  b,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c)

Error message macros

◆ PLAYER_WARN4

#define PLAYER_WARN4 (   msg,
  a,
  b,
  c,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d)

Error message macros

◆ PLAYER_WARN5

#define PLAYER_WARN5 (   msg,
  a,
  b,
  c,
  d,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e)

Error message macros

◆ PLAYER_WARN6

#define PLAYER_WARN6 (   msg,
  a,
  b,
  c,
  d,
  e,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f)

Error message macros

◆ PLAYER_WARN7

#define PLAYER_WARN7 (   msg,
  a,
  b,
  c,
  d,
  e,
  f,
 
)    ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f, g)

Error message macros