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

ArLog Class Reference

Logging utility class. More...

#include <ArLog.h>

List of all members.

Public Types

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

Static Public Member Functions

static void addToConfig (ArConfig *config)
 Class to add this to an ArConfig (ie Aria::getConfig()).
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.
static void log (LogLevel level, const char *str,...)
 Log a message.
static void logNoLock (LogLevel level, const char *str,...)
static void logPlain (LogLevel level, const char *str)

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


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.

Definition at line 48 of file ArLog.h.


Member Enumeration Documentation

enum ArLog::LogLevel
 

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

Definition at line 59 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 52 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.

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 125 of file ArLog.cpp.

References close(), Colbert, File, ArMutex::lock(), None, Normal, StdErr, StdOut, Terse, ArMutex::unlock(), and Verbose.

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

Log a message.

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

Definition at line 63 of file ArLog.cpp.

References Colbert, ArMutex::lock(), None, and ArMutex::unlock().

Referenced by ArModeCamera::activate(), ArAnalogGyro::activate(), ArActionTriangleDriveTo::activate(), ArActionGroup::activate(), ArActionGroup::activateExclusive(), ArRobot::addAction(), ArActionGroup::addAction(), ArActionRatioInput::addActivateCallback(), ArNetServer::addCommand(), ArSick::addConnectCB(), ArRobot::addConnectCB(), ArSick::addDataCB(), ArActionRatioInput::addDeactivateCallback(), ArSick::addDisconnectNormallyCB(), ArRobot::addDisconnectNormallyCB(), ArSick::addDisconnectOnErrorCB(), ArRobot::addDisconnectOnErrorCB(), ArVCC4::addErrorCB(), Aria::addExitCallback(), ArSick::addFailedConnectCB(), ArRobot::addFailedConnectCB(), ArFileParser::addHandler(), ArSignalHandler::addHandlerCB(), ArFileParser::addHandlerWithError(), ArKeyHandler::addKeyHandler(), ArMap::addMapChangedCB(), ArTime::addMSec(), ArRobot::addPacketHandler(), ArConfig::addParam(), ArRobot::addRunExitCB(), ArRobot::addStabilizingCB(), ArCondition::ArCondition(), ArConfig::ArConfig(), ArMode::ArMode(), ArSickLogger::ArSickLogger(), ArVCC4::ArVCC4(), ArVersalogicIO::ArVersalogicIO(), ArSick::asyncConnect(), ArRobot::asyncConnectHandler(), ArMode::baseHelp(), ArCondition::broadcast(), ArSonyPacket::byte2ToBuf(), ArAMPTUPacket::byte2ToBuf(), ArSonyPacket::byte2ToBufAtPos(), ArAMPTUPacket::byteToBuf(), Aria::callExitCallbacks(), ArConfig::callProcessFileCallBacks(), ArRobot::cancelConnection(), ArArgumentParser::checkHelpAndWarnUnparsed(), ArArgumentParser::checkParameterArgumentBool(), ArArgumentParser::checkParameterArgumentInteger(), ArArgumentParser::checkParameterArgumentString(), ArSocket::close(), ArSerialConnection::close(), ArNetServer::close(), ArModuleLoader::close(), ArRobot::com(), ArRobot::com2Bytes(), ArRobot::comInt(), ArRobot::comStr(), ArRobot::comStrN(), ArSick::configure(), ArSick::configureShort(), ArSimpleConnector::connectLaserArbitrary(), ArThread::create(), ArSoundsQueue::createDefaultFileItem(), ArRangeDevice::cumulativeReadingBox(), ArRangeDevice::cumulativeReadingPolar(), ArRangeDevice::currentReadingBox(), ArRangeDevice::currentReadingPolar(), ArModeCamera::deactivate(), ArAnalogGyro::deactivate(), ArActionGroup::deactivate(), ArRobot::deactivateActions(), ArThread::detach(), ArSick::disconnect(), ArRobot::disconnect(), ArSick::dropConnection(), ArRobot::dropConnection(), ArAnalogGyro::encoderCorrect(), ArRobot::failedConnect(), ArActionTriangleDriveTo::findTriangle(), ArActionTriangleDriveTo::fire(), ArActionInput::fire(), ArActionGotoStraight::fire(), ArActionDeceleratingLimiter::fire(), ArDaemonizer::forceDaemonize(), ArVersalogicIO::getAnalogValue(), ArACTS_1_2::getBlob(), ArGripper::getBreakBeamState(), ArRobot::getClosestSonarNumber(), ArGripper::getGripState(), ArJoyHandler::getNewData(), ArGripper::getPaddleState(), ArUtil::getStringFromRegistry(), ArRatioInputKeydrive::giveUpKeys(), ArActionKeydrive::giveUpKeys(), ArMap::handleData(), ArRobot::handlePacket(), ArModeTCM2::help(), ArModeActs::help(), ArModeSonar::help(), ArModeCamera::help(), ArModeGripper::help(), ArModeWander::help(), ArModeUnguardedTeleop::help(), ArModeTeleop::help(), ArP2Arm::init(), ArJoyHandler::init(), Aria::init(), ArAMPTU::init(), ArArgumentBuilder::internalAdd(), ArSick::internalConnectHandler(), ArSick::internalConnectSim(), ArTcpConnection::internalOpen(), ArNetServer::internalQuit(), ArSoundsQueue::invokeCallbacks(), ArGripper::isGripMoving(), ArGripper::isLiftMaxed(), ArGripper::isLiftMoving(), ArRobot::keyHandlerExit(), ArModuleLoader::load(), ArArgumentParser::loadDefaultArguments(), ArRobot::loadParamFile(), ArMutex::lock(), ArSyncTask::log(), ArRobotConfigPacketReader::log(), ArTime::log(), ArPose::log(), ArConfigArg::log(), ArArgumentParser::log(), ArArgumentBuilder::log(), ArArg::log(), ArACTSBlob::log(), ArAction::log(), ArRobot::logActions(), ArArgumentParser::logDefaultArgumentLocations(), ArSimpleConnector::logLaserOptions(), ArSimpleConnector::logOptions(), ArDaemonizer::logOptions(), logPlain(), ArGripper::logState(), ArThread::logThreadInfo(), ArRobot::madeConnection(), ArMap::mapChanged(), ArNetServer::open(), ArACTS_1_2::openPort(), ArVCC4::packetHandler(), ArRobot::packetHandler(), ArGripper::packetHandler(), ArConfig::parseArgument(), ArConfig::parseArgumentParser(), ArNetServer::parseCommandOnSocket(), ArFileParser::parseFile(), ArSimpleConnector::parseLaserArgs(), ArFileParser::parseLine(), ArConfig::parseSection(), ArMap::parsingComplete(), ArSoundPlayer::playSoundPCM16(), ArSoundPlayer::playWavFile(), ArP2Arm::powerOff(), ArP2Arm::powerOn(), ArRobot::processMotorPacket(), ArRobot::processNewSonar(), ArSick::processPacket(), ArTcpConnection::read(), ArSerialConnection::read(), ArLogFileConnection::read(), ArMap::readFile(), ArVCC4::readPacket(), ArSocket::readString(), ArACTS_1_2::receiveBlobInfo(), ArSickPacketReceiver::receivePacket(), ArRobotPacketReceiver::receivePacket(), ArActionGroup::remAction(), ArActionRatioInput::remFireCallback(), ArFileParser::remHandler(), ArKeyHandler::remKeyHandler(), ArActionGroup::removeActions(), ArArgumentParser::removeArg(), ArArgumentBuilder::removeArg(), ArACTS_1_2::requestPacket(), ArACTS_1_2::requestQuit(), ArSoundsQueue::resume(), ArSick::robotConnectCallback(), ArSyncTask::run(), ArRobot::run(), ArRobot::runAsync(), ArASyncTask::runInThisThread(), ArNetServer::runOnce(), ArSoundsQueue::runThread(), ArLineFinder::saveLast(), ArVCC4::sendLEDControlMode(), ArNetServer::sendToAllClientsPlain(), ArSick::sensorInterpCallback(), ArConfigArg::setArgWithFunctor(), ArArg::setArgWithFunctor(), ArSerialConnection::setBaud(), ArConfigArg::setBool(), ArArg::setBool(), ArVersalogicIO::setDigitalBankDirection(), ArConfigArg::setDouble(), ArArg::setDouble(), ArSick::setFilterCleanCumulativeInterval(), ArSick::setFilterCumulativeCleanDist(), ArSick::setFilterCumulativeInsertMaxDist(), ArSick::setFilterCumulativeNearDist(), ArSick::setFilterNearDist(), ArSerialConnection::setHardwareControl(), ArConfigArg::setInt(), ArArg::setInt(), ArArg::setPose(), ArRobot::setRotVelMax(), ArConfig::setSectionComment(), ArConfigArg::setString(), ArArg::setString(), ArTime::setToNow(), ArRobot::setTransVelMax(), ArSimpleConnector::setupLaserArbitrary(), ArSimpleConnector::setupRobot(), ArCondition::signal(), Aria::signalHandlerCB(), ArSick::simPacketHandler(), ArAnalogGyro::stabilizingCallback(), ArRobot::stateReflector(), ArSoundPlayer::stopPlaying(), ArUtil::stripQuotes(), ArRatioInputKeydrive::takeKeys(), ArActionKeydrive::takeKeys(), ArThread::threadStarted(), ArCondition::timedWait(), ArSonyPacket::uByteToBuf(), ArMutex::unlock(), ArModeGripper::userTask(), ArCondition::wait(), ArTcpConnection::write(), ArSerialConnection::write(), ArMap::writeFile(), ArConfigGroup::writeFile(), ArConfig::writeFile(), ArMap::writeObjectsToFunctor(), ArSocket::writeString(), ArCondition::~ArCondition(), and ArVersalogicIO::~ArVersalogicIO().

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

Log a message without varargs (wrapper for java) Log a message

Definition at line 52 of file ArLog.cpp.

References log().


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:49 2005 for Aria by  doxygen 1.4.0