/usr/include/rlog/rlog-c99.h is in librlog-dev 1.4-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | /*****************************************************************************
* Author: Valient Gough <vgough@pobox.com>
*
*****************************************************************************
* Copyright (c) 2002-2004, Valient Gough
*
* This library is free software; you can distribute it and/or modify it under
* the terms of the GNU Lesser General Public License (LGPL), as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the LGPL in the file COPYING for more
* details.
*
*/
/*! @def _rMessageDef
Defines a static RLogPublisher and points it to the registration function for
the first call.
@internal
*/
#define _rMessageDef(ID, COMPONENT) \
static rlog::PublishLoc ID RLOG_SECTION = {& ID ## _enabled, \
&rlog::RLog_Register, 0, STR(COMPONENT), __FILE__, \
__FUNCTION__, __LINE__, 0};
/*! @def _rMessageCall
Checks if the RLogPublisher is enabled and publishes the message if so.
@internal
*/
#if HAVE_PRINTF_FP || !HAVE_PRINTF_ATTR
# define _rMessageCall(ID, COMPONENT, CHANNEL, ...) \
static bool ID ## _enabled = true; \
if(unlikely(ID ## _enabled)) \
{ \
_rMessageDef(ID, COMPONENT) \
(*ID.publish)( &ID, CHANNEL, ##__VA_ARGS__ ); \
}
#else // no PRINTF attributes..
# define _rMessageCall(ID, COMPONENT, CHANNEL, ...) \
static bool ID ## _enabled = true; \
if(unlikely(ID ## _enabled)) \
{ \
_rMessageDef(ID, COMPONENT) \
(*ID.publish)( &ID, CHANNEL, ##__VA_ARGS__ ); \
rlog::__checkArgs( 0, ##__VA_ARGS__ ); \
}
#endif
/*! @def _rMessage(ID, CHANNEL, ... )
Combines the publisher definition (_rMessageDef) and invokation
(_rMessageCall)
enclose in do{}while(0) to insure that it acts as a single statement even if
placed in various if/else constructs..
@internal
*/
#define _rMessage(ID, CHANNEL, ... ) \
do { _rMessageCall(ID, RLOG_COMPONENT, CHANNEL, ##__VA_ARGS__ ) } while(0)
/*! @addtogroup RLogMacros
These macros are the primary interface for logging messages:
- rDebug(format, ...)
- rInfo(format, ...)
- rWarning(format, ...)
- rError(format, ...)
- rLog(channel, format, ...)
- rAssert( condition )
@{
*/
/*! @def rDebug(format, ...)
@brief Log a message to the "debug" channel. Takes printf style arguments.
Format is ala printf, eg:
@code
rDebug("I'm sorry %s, I can't do %s", name, request);
@endcode
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 rDebug(...) \
_rMessage( LOGID, rlog::_RLDebugChannel, ##__VA_ARGS__ )
/*! @def rInfo(format, ...)
@brief Log a message to the "debug" channel. Takes printf style arguments.
Format is ala printf, eg:
@code
rInfo("I'm sorry %s, I can't do %s", name, request);
@endcode
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 rInfo(...) \
_rMessage( LOGID, rlog::_RLInfoChannel, ##__VA_ARGS__ )
/*! @def rWarning(format, ...)
@brief 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:
@code
rWarning("passed %i, expected %i, continuing", foo, bar);
@endcode
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__ )
/*! @def rError(...)
@brief 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:
@code
rError("bad input %s, aborting request", input);
@endcode
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__ )
/*! @def rLog(channel,format,...)
@brief 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:
@code
static RLogChannel * MyChannel = RLOG_CHANNEL( "debug/mine" );
rLog(MyChannel, "happy happy, joy joy");
@endcode
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__ )
|