}
void osrfLogDetail( int level, char* filename, int line, char* func, char* msg, ... ) {
+ if(!msg) return;
+ VA_LIST_TO_STRING(msg);
+ _osrfLogDetail( level, filename, line, func, VA_BUF );
+}
+
+void _osrfLogDetail( int level, char* filename, int line, char* func, char* msg ) {
if( level == OSRF_LOG_ACTIVITY && ! __osrfLogActivityEnabled ) return;
if( level > __osrfLogLevel ) return;
break;
}
- VA_LIST_TO_STRING(msg);
-
if(__osrfLogType == OSRF_LOG_TYPE_SYSLOG )
- syslog( fac | lvl, "[%s:%d:%s:%s:%s] %s", l, getpid(), filename, lb, func, VA_BUF );
+ syslog( fac | lvl, "[%s:%d:%s:%s:%s] %s", l, getpid(), filename, lb, func, msg );
else if( __osrfLogType == OSRF_LOG_TYPE_FILE )
- _osrfLogToFile("[%s:%d:%s:%s:%s] %s", l, getpid(), filename, lb, func, VA_BUF );
+ _osrfLogToFile("[%s:%d:%s:%s:%s] %s", l, getpid(), filename, lb, func, msg );
}
#define OSRF_LOG_GO(m,l) \
if(!m) return; \
VA_LIST_TO_STRING(m); \
- osrfLogDetail( l, NULL, -1, NULL, VA_BUF );
+ _osrfLogDetail( l, NULL, -1, NULL, VA_BUF );
* and function name in addition to the usual level and message */
void osrfLogDetail( int level, char* filename, int line, char* func, char* msg, ... );
+/** Actually does the logging */
+void _osrfLogDetail( int level, char* filename, int line, char* func, char* msg );
+
void _osrfLogToFile( char* msg, ... );
/* returns the int representation of the log facility based on the facility name