Logging Class Reference

#include <Logging.h>

List of all members.

Public Member Functions

 Logging ()
void Init (int level, long baud)
void Error (char *msg,...)
void Info (char *msg,...)
void Debug (char *msg,...)
void Verbose (char *msg,...)

Private Member Functions

void print (const char *format, va_list args)

Private Attributes

int _level
long _baud


Detailed Description

Logging is a helper class to output informations over RS232. If you know log4j or log4net, this logging class is more or less similar ;-)
Different loglevels can be used to extend or reduce output All methods are able to handle any number of output parameters. All methods print out a formated string (like printf).
To reduce output and program size, reduce loglevel.
Output format string can contain below wildcards. Every wildcard must be start with percent sign (%)

Depending on loglevel, source code is excluded from compile !

Wildcards


Loglevels
0LOG_LEVEL_NOOUTPUTno output
1LOG_LEVEL_ERRORSonly errors
2LOG_LEVEL_INFOSerrors and info
3LOG_LEVEL_DEBUGerrors, info and debug
4LOG_LEVEL_VERBOSEall

History


01 FEB 2012initial release
06 MAR 2012implement a preinstanciate object (like in Wire, ...)
methode init get now loglevel and baud parameter

Definition at line 71 of file Logging.h.


Constructor & Destructor Documentation

Logging::Logging (  )  [inline]

default Constructor

Definition at line 79 of file Logging.h.


Member Function Documentation

void Logging::Init ( int  level,
long  baud 
)

Initializing, must be called as first.

Parameters:
void 
Returns:
void

Definition at line 3 of file Logging.cpp.

References _baud, _level, LOG_LEVEL_NOOUTPUT, and LOG_LEVEL_VERBOSE.

void Logging::Error ( char *  msg,
  ... 
)

Output an error message. Output message contains ERROR: followed by original msg Error messages are printed out, at every loglevel except 0 ;-)

Parameters:
msg format string to output
... any number of variables
Returns:
void

Definition at line 9 of file Logging.cpp.

References _level, LOG_LEVEL_ERRORS, and print().

Here is the call graph for this function:

void Logging::Info ( char *  msg,
  ... 
)

Output an info message. Output message contains Info messages are printed out at l loglevels >= LOG_LEVEL_INFOS

Parameters:
msg format string to output
... any number of variables
Returns:
void

Definition at line 19 of file Logging.cpp.

References _level, LOG_LEVEL_INFOS, and print().

Here is the call graph for this function:

void Logging::Debug ( char *  msg,
  ... 
)

Output an debug message. Output message contains Debug messages are printed out at l loglevels >= LOG_LEVEL_DEBUG

Parameters:
msg format string to output
... any number of variables
Returns:
void

Definition at line 27 of file Logging.cpp.

References _level, LOG_LEVEL_DEBUG, and print().

Here is the call graph for this function:

void Logging::Verbose ( char *  msg,
  ... 
)

Output an verbose message. Output message contains Debug messages are printed out at l loglevels >= LOG_LEVEL_VERBOSE

Parameters:
msg format string to output
... any number of variables
Returns:
void

Definition at line 36 of file Logging.cpp.

References _level, LOG_LEVEL_VERBOSE, and print().

Here is the call graph for this function:

void Logging::print ( const char *  format,
va_list  args 
) [private]

Definition at line 46 of file Logging.cpp.

Referenced by Debug(), Error(), Info(), and Verbose().


Member Data Documentation

int Logging::_level [private]

Definition at line 73 of file Logging.h.

Referenced by Debug(), Error(), Info(), Init(), and Verbose().

long Logging::_baud [private]

Definition at line 74 of file Logging.h.

Referenced by Init().


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

Generated on Tue Mar 6 20:17:24 2012 for Logging by  doxygen 1.5.6