[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Add function names to log_* on non-gcc
Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv13588/common
Modified Files:
log.c log.h
Log Message:
Add function names to log_* on non-gcc
Index: log.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -p -d -r1.114 -r1.115
--- log.c 18 Feb 2006 02:11:48 -0000 1.114
+++ log.c 18 Feb 2006 07:18:14 -0000 1.115
@@ -264,47 +264,47 @@ _log_fn(int severity, uint32_t domain, c
_log_fn_function_name = NULL;
}
void
-log_debug(uint32_t domain, const char *format, ...)
+_log_debug(uint32_t domain, const char *format, ...)
{
va_list ap;
va_start(ap,format);
- logv(LOG_DEBUG, domain, NULL, format, ap);
+ logv(LOG_DEBUG, domain, _log_fn_function_name, format, ap);
va_end(ap);
_log_fn_function_name = NULL;
}
void
-log_info(uint32_t domain, const char *format, ...)
+_log_info(uint32_t domain, const char *format, ...)
{
va_list ap;
va_start(ap,format);
- logv(LOG_INFO, domain, NULL, format, ap);
+ logv(LOG_INFO, domain, _log_fn_function_name, format, ap);
va_end(ap);
_log_fn_function_name = NULL;
}
void
-log_notice(uint32_t domain, const char *format, ...)
+_log_notice(uint32_t domain, const char *format, ...)
{
va_list ap;
va_start(ap,format);
- logv(LOG_NOTICE, domain, NULL, format, ap);
+ logv(LOG_NOTICE, domain, _log_fn_function_name, format, ap);
va_end(ap);
_log_fn_function_name = NULL;
}
void
-log_warn(uint32_t domain, const char *format, ...)
+_log_warn(uint32_t domain, const char *format, ...)
{
va_list ap;
va_start(ap,format);
- logv(LOG_WARN, domain, NULL, format, ap);
+ logv(LOG_WARN, domain, _log_fn_function_name, format, ap);
va_end(ap);
_log_fn_function_name = NULL;
}
void
-log_err(uint32_t domain, const char *format, ...)
+_log_err(uint32_t domain, const char *format, ...)
{
va_list ap;
va_start(ap,format);
- logv(LOG_ERR, domain, NULL, format, ap);
+ logv(LOG_ERR, domain, _log_fn_function_name, format, ap);
va_end(ap);
_log_fn_function_name = NULL;
}
Index: log.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.h,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -p -d -r1.66 -r1.67
--- log.h 18 Feb 2006 02:11:48 -0000 1.66
+++ log.h 18 Feb 2006 07:18:14 -0000 1.67
@@ -142,15 +142,20 @@ void _log_fn(int severity, uint32_t doma
#else /* ! defined(__GNUC__) */
void _log_fn(int severity, uint32_t domain, const char *format, ...);
-void log_debug(uint32_t domain, const char *format, ...);
-void log_info(uint32_t domain, const char *format, ...);
-void log_notice(uint32_t domain, const char *format, ...);
-void log_warn(uint32_t domain, const char *format, ...);
-void log_err(uint32_t domain, const char *format, ...);
+void _log_debug(uint32_t domain, const char *format, ...);
+void _log_info(uint32_t domain, const char *format, ...);
+void _log_notice(uint32_t domain, const char *format, ...);
+void _log_warn(uint32_t domain, const char *format, ...);
+void _log_err(uint32_t domain, const char *format, ...);
#if defined(_MSC_VER) && _MSC_VER < 1300
/* MSVC 6 and earlier don't have __FUNCTION__, or even __LINE__. */
#define log_fn _log_fn
+#define log_debug _log_debug
+#define log_info _log_info
+#define log_notice _log_notice
+#define log_warn _log_warn
+#define log_err _log_err
/*
#define debug _debug
#define info _info
@@ -166,6 +171,11 @@ extern const char *_log_fn_function_name
* do {...} while (0) trick to wrap this macro, since the macro can't take
* arguments. */
#define log_fn (_log_fn_function_name=__FUNCTION__),_log_fn
+#define log_debug (_log_fn_function_name=__FUNCTION__),_log_debug
+#define log_info (_log_fn_function_name=__FUNCTION__),_log_info
+#define log_notice (_log_fn_function_name=__FUNCTION__),_log_notice
+#define log_warn (_log_fn_function_name=__FUNCTION__),_log_warn
+#define log_err (_log_fn_function_name=__FUNCTION__),_log_err
/*
#define debug (_log_fn_function_name=__FUNCTION__),_debug
#define info (_log_fn_function_name=__FUNCTION__),_info