Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages | Examples

ArLog Class Reference

#include <ArLog.h>

List of all members.


Detailed Description

Logging utility class.

ArLog is a utility class to log all messages from Aria to a choosen destintation. Messages can be logged to stdout, stderr, a file, and turned off completely. Logging by default is set to stdout. The level of logging can be changed as well. Allowed levels are Terse, Normal, and Verbose. By default the level is set to Normal.

Examples:

dpptuExample.cpp, gotoActionExample.cpp, gyroExample.cpp, moduleExample.cpp, and moduleExample_Mod.cpp.

Definition at line 47 of file ArLog.h.

Public Types

enum  LogLevel { Terse, Normal, Verbose }
enum  LogType {
  StdOut, StdErr, File, Colbert,
  None
}

Static Public Member Functions

static void addToConfig (ArConfig *config)
 Use an ArConfig object to control ArLog's options.
static void close ()
 Close the logging utility.
static bool init (LogType type, LogLevel level, const char *fileName="", bool logTime=false, bool alsoPrint=false, bool printThisCall=true)
 Initialize the logging utility with options.
static void log (LogLevel level, const char *str,...)
 Log a message, with formatting and variable number of arguments

Java and Python Wrappers: In Java and Python, this function only takes one string argument. Use Java or Python's native facities for constructing a formatted string, e.g. the and + string operators in Python, and the methods of the Java String class.

static void logNoLock (LogLevel level, const char *str,...)
static void logPlain (LogLevel level, const char *str)
 Log a message containing just a plain string.

Static Public Attributes

static void(* colbertPrint )(int i, const char *str)

Static Protected Member Functions

static bool processFile (void)

Static Protected Attributes

static bool ourAlsoPrint = false
static int ourColbertStream = -1
static bool ourConfigAlsoPrint = false
static char ourConfigFileName [1024] = "log.txt"
static LogLevel ourConfigLogLevel = ArLog::Normal
static bool ourConfigLogTime = false
static LogType ourConfigLogType = ArLog::StdOut
static ArGlobalRetFunctor<
bool > 
ourConfigProcessFileCB
static std::string ourFileName
static FILE * ourFP = 0
static LogLevel ourLevel = ArLog::Normal
static ArLogourLog
static bool ourLoggingTime = false
static ArMutex ourMutex
static LogType ourType = StdOut


Member Enumeration Documentation

enum ArLog::LogLevel
 

Enumeration values:
Terse  Use terse logging.
Normal  Use normal logging.
Verbose  Use verbose logging.

Definition at line 58 of file ArLog.h.

enum ArLog::LogType
 

Enumeration values:
StdOut  Use stdout for logging.
StdErr  Use stderr for logging.
File  Use a file for logging.
Colbert  Use a Colbert stream for logging.
None  Disable logging.

Definition at line 51 of file ArLog.h.


Member Function Documentation

bool ArLog::init LogType  type,
LogLevel  level,
const char *  fileName = "",
bool  logTime = false,
bool  alsoPrint = false,
bool  printThisCall = true
[static]
 

Initialize the logging utility with options.

Initialize the logging utility by supplying the type of logging and the level of logging. If the type is File, the fileName needs to be supplied.

Parameters:
type type of Logging
level level of logging
fileName the name of the file for File type of logging
logTime if this is true then the time a message is given will be logged
alsoPrint if this is true then in addition to whatever other logging (to a file for instance) the results will also be printed
printThisCall if this is true the new settings will be printed otherwise they won't

Definition at line 142 of file ArLog.cpp.

void ArLog::log LogLevel  level,
const char *  str,
  ...
[static]
 

Log a message, with formatting and variable number of arguments

Java and Python Wrappers: In Java and Python, this function only takes one string argument. Use Java or Python's native facities for constructing a formatted string, e.g. the and + string operators in Python, and the methods of the Java String class.

This function is used like printf(). If the supplied level is less than or equal to the set level, it will be printed.

Parameters:
level level of logging
str printf() like formating string
Examples:
actionExample.cpp, actionGroupExample.cpp, actsColorFollowingExample.cpp, armExample.cpp, auxSerialExample.cpp, configExample.cpp, dpptuExample.cpp, gpsExample.cpp, gripperExample.cpp, lineFinderExample.cpp, moduleExample.cpp, moduleExample_Mod.cpp, robotConnectionCallbacks.cpp, simpleConnect.cpp, socketClientExample.cpp, socketServerExample.cpp, sonyPTZDemo.cpp, threadExample.cpp, and vcc4CameraExample.cpp.

Definition at line 70 of file ArLog.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:43 2007 for Aria by  doxygen 1.4.0