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

RLogMacros


Defines

#define rDebug()   _rMessage( LOGID, rlog::_RLDebugChannel, ##__VA_ARGS__ )
 Log a message to the "debug" channel. Takes printf style arguments.

#define rWarning()   _rMessage( LOGID, rlog::_RLWarningChannel, ##__VA_ARGS__ )
 Log a message to the "warning" channel. Takes printf style arguments.

#define rError()   _rMessage( LOGID, rlog::_RLErrorChannel, ##__VA_ARGS__ )
 Log a message to the "error" channel. Takes printf style arguments.

#define rLog(channel,)   _rMessage( LOGID, channel, ##__VA_ARGS__ )
 Log a message to a user defined channel. Takes a channel and printf style arguments.

#define _rAssertFailed(COMPONENT, COND)   rlog::rAssertFailed(STR(COMPONENT),__FILE__,__FUNCTION__,__LINE__, COND)
#define rAssert(cond)
 Assert condition - throws error if cond evaluates to false.

#define rAssertSilent(cond)
 Assert condition - throws error if cond evaluates to false, but does not display error message.

#define _ERROR_IMPL(COMPONENT, MSG)   rlog::Error( STR(COMPONENT), __FILE__, __FUNCTION__, __LINE__, MSG )
#define ERROR(MSG)   _ERROR_IMPL( RLOG_COMPONENT, MSG )

Detailed Description

These macros are the primary interface for logging messages:

These macros are the primary interface for logging messages:


Define Documentation

#define rAssert cond   ) 
 

Value:

do { \
        if( unlikely((cond) == false) ) \
        { rError( "Assert failed: " STR(cond) ); \
          _rAssertFailed(RLOG_COMPONENT, STR(cond)); \
        } \
    } while(0)
Assert condition - throws error if cond evaluates to false.

Assert error condition. Displays error message if condition does not evaluate to TRUE.

We throw an error from rAssertFailed. It isn't done inline so that we don't have to include the STL exception code here and bloat callers that don't use it or don't care.

#define rAssertSilent cond   ) 
 

Value:

do { \
        if( unlikely((cond) == false) ) \
        { _rAssertFailed(RLOG_COMPONENT, STR(cond)); } \
    } while(0)
Assert condition - throws error if cond evaluates to false, but does not display error message.

Assert error condition. Similar to rAssert except that it does not display an error.

 
#define rDebug  )     _rMessage( LOGID, rlog::_RLDebugChannel, ##__VA_ARGS__ )
 

Log a message to the "debug" channel. Takes printf style arguments.

Format is ala printf, eg:

    rDebug("I'm sorry %s, I can't do %s", name, request);

When using a recent GNU compiler, it should automatically detect format string / argument mismatch just like it would with printf.

Note that unless there are subscribers to this message, it will do nothing.

 
#define rError  )     _rMessage( LOGID, rlog::_RLErrorChannel, ##__VA_ARGS__ )
 

Log a message to the "error" channel. Takes printf style arguments.

An error indicates that something has definately gone wrong.

Format is ala printf, eg:

    rError("bad input %s, aborting request", input);

When using a recent GNU compiler, it should automatically detect format string / argument mismatch just like it would with printf.

Note that unless there are subscribers to this message, it will do nothing.

#define rLog channel   )     _rMessage( LOGID, channel, ##__VA_ARGS__ )
 

Log a message to a user defined channel. Takes a channel and printf style arguments.

An error indicates that something has definately gone wrong.

Format is ala printf, eg:

    static RLogChannel * MyChannel = RLOG_CHANNEL( "debug/mine" );
    rLog(MyChannel, "happy happy, joy joy");

When using a recent GNU compiler, it should automatically detect format string / argument mismatch just like it would with printf.

Note that unless there are subscribers to this message, it will do nothing.

 
#define rWarning  )     _rMessage( LOGID, rlog::_RLWarningChannel, ##__VA_ARGS__ )
 

Log a message to the "warning" channel. Takes printf style arguments.

Output a warning message - meant to indicate that something doesn't seem right.

Format is ala printf, eg:

    rWarning("passed %i, expected %i, continuing", foo, bar);

When using a recent GNU compiler, it should automatically detect format string / argument mismatch just like it would with printf.

Note that unless there are subscribers to this message, it will do nothing.


Generated on Sun Mar 14 14:49:50 2004 for rlog by doxygen 1.3.2