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

vos/corelibs/vos/log.hh File Reference

Defines Log. More...

Go to the source code of this file.

Namespaces

Defines


Detailed Description

Defines Log.

See also:
LOG

Definition in file log.hh.


Define Documentation

#define LOG c,
l,
m   ) 
 

Value:

{         \
    if(l <= Log::masterLogLevel) { \
        Log* _lg = Log::getLog(c); \
        if(! _lg) { _lg=new Log(c); Log::addChannel(_lg); }  \
        if(_lg->getLevel() >= l) {  \
          ostringstream _x;        \
          _x << m;                 \
          _lg->log(l, _x.str());    \
        }                          \
    } \
}
log.hh vos/corelibs/vos/log.hh

Parameters:
c (string) the logging channel, which will be created if it does not exist
l (int) the logging level (0 is the highest priority, 5 being the lowest priority.
m The actual log message. This is actually used as an output into a stream, so the whole C++ stream output API is available In other words, can use expressions like:
        LOG("foo", 3, "x = " << x << "\n");
You can control log levels using the setLevel(), setDefaultLevel(), setMasterLevel(), and also by setting an environment variables named VOS_LOG and VOS_MASTER_LOGLEVEL. The LOG macro first checks the master loglevel. If (l) is greater than the master level, no logging message will be printed. Next, LOG checks the level for the channel. if (l) is less than or equal to the channel's level, the message is printed.

The format of the VOS_LOG environment variable is channel1=level1,channel2=level2,.... Don't use any spaces. VOS_MASTER_LOGLEVEL should contain a single (positive) integer. Both environment variables are entirely optional.

LOG must be a macro because of the way output streams are used (believe me, I tried other ways...) Note that also, because it is a macro, you pay no penalty related to creating output the if string if it isn't going be printed; the log level is checked beforehand.

Definition at line 83 of file log.hh.

Referenced by VOS::RemoteVobject::acquire(), LocalSearch::actOnChildren(), VOS::VobjectImplementation::addChildListener(), VOS::VobjectImplementation::addParentListener(), LocalSite::addPrioritizedNonce(), VOS::MessageContext::addToReplyRecord(), VOS::VobjectImplementation::addType(), VOS::RemoteVobject::addType(), VOS::VobjectImplementation::addTypeListener(), RemoteProperty::asyncRead(), VOS::LocalSocketSite::calculateTimeout(), COD::checkCOD(), Property::checkDecoded(), FestTalk::close_server(), VOS::RemoteSite::createMetaObject(), TypeChain::decode(), LocalTalkative::do_say(), FestTalk::do_say(), LocalSearch::doActions(), LocalSite::doCallbacks(), Property::doExcise(), RemoteSearch::doSearch(), VOS::MessageContext::doSubstitution(), VOS::VobjectImplementation::excise(), VOS::RemoteSocketSite::excise(), VOS::RemoteSite::excise(), BufferedRemoteProperty::flush(), BufferedLocalProperty::flushAll(), VOS::RemoteStreamSite::flushIncomingBuffers(), VOS::RemoteSocketSite::flushIncomingBuffers(), VOS::LocalSocketSite::flushIncomingBuffers(), LocalSite::flushNotifications(), A3DL::Material::getColor(), Services::getDefaultServicesDir(), VOSGUI::NumericInput::getIncrement(), VOSGUI::NumericInput::getMaximum(), VOSGUI::NumericInput::getMinimum(), A3DL::Viewpoint::getOrientation(), A3DL::Viewpoint::getPosition(), A3DL::Light::getPosition(), Text::getText(), A3DL::Material::getTextureLayer(), VOS::RemoteVobject::getTypes(), GPSPosition::GPSPosition(), RemoteServices::handleAdvertisement(), VOS::RemoteStreamSite::handleDisconnection(), VOS::RemoteSocketSite::handleDisconnection(), LocalServices::handleQuery(), VOSGUI::RemoteContainer::handleRaise(), LocalHostedAvatar::handleRequestAvatar(), LocalSearch::handleSearch(), RemoteSearch::handleSearchDone(), VOSGUI::SelectValue::initialize(), VOSGUI::SelectList::initialize(), TypeChain::initialize(), LocalProperty::initializeSecurity(), VOS::VobjectImplementation::insertChild(), main(), LocalSearch::makeRules(), VOS::Message::Message(), VOS::VobjectNotifyEvent::notify(), VOS::RemoteSite::notifyChildInserted(), VOSChatGUI::PrivMsg::notifyChildInserted(), VOSChatGUI::AvatarList::notifyChildInserted(), VOSChatGUI::AvatarList::notifyChildRemoved(), ServiceListenerSiteWrapper::notifyNewService(), Property::notifyObjectExcise(), VOSChatGUI::PrivMsg::notifyObjectExcise(), PGDBProperty::open(), FestTalk::open_server(), VOS::AsyncConnect::operator()(), VOS::MessageBlock::parseUpdate(), RemoteServices::query(), PGDBProperty::queryDB(), VOSGUI::RemoteContainer::raise(), VOSGUI::LocalContainer::raise(), RemoteCOD::readCOD(), COD::readCOD(), COD::readObjectDesc(), RemoteProperty::readRaw(), VOS::RemoteSocketSite::readStream(), TypeChain::registerHandler(), VOS::RemoteVobject::release(), VOSGUI::RemoteContainer::RemoteContainer(), VOS::RemoteVobject::removeChild(), LocalSite::removePrioritizedNonce(), LocalSite::removeRemotePeer(), VOSGUI::Display::removeWindow(), FileProperty::replace(), LocalProperty::replaceHandler(), RemoteGateway::requestForward(), VOSDaemon::run(), LocalSite::runSchedule(), VOS::RemoteStreamSite::runScript(), VOSDaemon::save(), LocalSite::scheduleMessageBlock(), LocalSearch::search(), VOS::RemoteStreamSite::sendMessage(), VOS::RemoteSocketSite::sendMessage(), LocalSite::sendMessage(), ExtrapolatedRemoteProperty::sendUpdateMessage(), VOS::RemoteVobject::sendUpdateMessage(), VOS::RemoteSite::sendUpdateMessage(), VOS::RemoteMetaObject::sendUpdateMessage(), VOS::VobjectImplementation::setChild(), VOS::RemoteVobject::setChild(), A3DL::Texture::setImageToFile(), VOSGUI::Label::setLabelToFile(), A3DL::Model::setModelToFile(), Avatar::setSelectedObj(), VOSChatGUI::PrivMsg::setup(), LocalProperty::startListeningHandler(), LocalProperty::stopListeningHandler(), Directory::sync(), TypeChain::uninitialize(), GPSPosition::update(), ExtrapolatedProperty::updateAll(), DBProperty::updateFromDB(), DBProperty::updateToDB(), LocalProperty::validatePropertyAccess(), FileProperty::write(), VOS::RemoteSocketSite::writeStream(), GPSPosition::~GPSPosition(), VOS::Message::~Message(), VOS::MessageBlock::~MessageBlock(), VOS::MessageContext::~MessageContext(), VOS::Vobject::ParentChildRelation::~ParentChildRelation(), PropertyListenerSiteWrapper::~PropertyListenerSiteWrapper(), VOS::RemoteMetaObject::~RemoteMetaObject(), VOS::RemoteSite::~RemoteSite(), VOS::RemoteSocketSite::~RemoteSocketSite(), VOS::RemoteStreamSite::~RemoteStreamSite(), VOS::VobjectImplementation::~VobjectImplementation(), and VOSDaemon::~VOSDaemon().

#define LOG_MAXLINELENGTH   1024
 

Definition at line 64 of file log.hh.


Generated on Tue Aug 12 03:55:48 2003 for Interreality Project - VOS by doxygen 1.3.2