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

rlog-novariadic.h

00001 /***************************************************************************** 00002 * Author: Valient Gough <vgough@pobox.com> 00003 * 00004 ***************************************************************************** 00005 * Copyright (c) 2002-2004, Valient Gough 00006 * 00007 * This library is free software; you can distribute it and/or modify it under 00008 * the terms of the GNU Lesser General Public License (LGPL), as published by 00009 * the Free Software Foundation; either version 2.1 of the License, or (at your 00010 * option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the LGPL in the file COPYING for more 00015 * details. 00016 * 00017 */ 00018 00019 #include <stdarg.h> // for va_list 00020 #include <stdio.h> // for NULL 00021 00022 class _rMessageProxy 00023 { 00024 public: 00025 _rMessageProxy( rlog::RLogChannel *channel, 00026 rlog::PublishLoc *loc ) 00027 { 00028 this->loc = loc; 00029 loc->channel = channel; 00030 } 00031 00032 void log(const char *format, ...) PRINTF(2,3); 00033 void log(rlog::RLogChannel *channel, const char *format, ...) PRINTF(3,4); 00034 00035 private: 00036 rlog::PublishLoc *loc; 00037 }; 00038 00039 #define _rMessageDef(ID, COMPONENT) \ 00040 static rlog::PublishLoc ID ={&rlog::RLog_Register, 0, STR(COMPONENT), \ 00041 __FILE__, __FUNCTION__, __LINE__, 0} 00042 00043 #define _rMessage(ID, CHANNEL, COMPONENT) \ 00044 _rMessageDef(ID, COMPONENT); \ 00045 _rMessageProxy(CHANNEL, &ID).log 00046 00047 #define rDebug _rMessage( LOGID, rlog::_RLDebugChannel, RLOG_COMPONENT ) 00048 #define rInfo _rMessage( LOGID, rlog::_RLDebugChannel, RLOG_COMPONENT ) 00049 #define rWarning _rMessage( LOGID, rlog::_RLWarningChannel, RLOG_COMPONENT ) 00050 #define rError _rMessage( LOGID, rlog::_RLErrorChannel, RLOG_COMPONENT ) 00051 00052 #define rLog _rMessage ( LOGID, NULL, RLOG_COMPONENT) 00053

Generated on Wed Dec 8 22:52:02 2004 for rlog by doxygen 1.3.8