[or-cvs] Remove last vestiges of old logging interface.

Nick Mathewson nickm at seul.org
Tue Oct 25 18:01:03 UTC 2005


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv4883/src/common

Modified Files:
	log.h util.h 
Log Message:
Remove last vestiges of old logging interface.

Index: log.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- log.h	25 Oct 2005 17:58:43 -0000	1.57
+++ log.h	25 Oct 2005 18:01:00 -0000	1.58
@@ -114,6 +114,7 @@
 
 /* Outputs a message to stdout */
 void _log(int severity, unsigned int domain, const char *format, ...) CHECK_PRINTF(3,4);
+#define log _log /* hack it so we don't conflict with log() as much */
 
 #ifdef __GNUC__
 void _log_fn(int severity, unsigned int domain,
@@ -121,16 +122,8 @@
   CHECK_PRINTF(4,5);
 /** Log a message at level <b>severity</b>, using a pretty-printed version
  * of the current function name. */
-#ifdef OLD_LOG_INTERFACE
-#define log_fn(severity, args...)                               \
-  _log_fn(severity, LD_GENERAL, __PRETTY_FUNCTION__, args)
-#define log(severity, args...)                                  \
-  _log(severity, LD_GENERAL, args)
-#else
 #define log_fn(severity, domain, args...)               \
   _log_fn(severity, domain, __PRETTY_FUNCTION__, args)
-#define log _log
-#endif
 #define debug(domain, args...)                          \
   _log_fn(LOG_DEBUG, domain, __PRETTY_FUNCTION__, args)
 #define info(domain, args...)                           \
@@ -141,7 +134,8 @@
   _log_fn(LOG_WARN, domain, __PRETTY_FUNCTION__, args)
 #define err(domain, args...)                            \
   _log_fn(LOG_ERR, domain, __PRETTY_FUNCTION__, args)
-#else
+
+#else /* ! defined(__GNUC__) */
 
 void _log_fn(int severity, unsigned int domain, const char *format, ...);
 void _debug(unsigned int domain, const char *format, ...);
@@ -150,8 +144,6 @@
 void _warn(unsigned int domain, const char *format, ...);
 void _err(unsigned int domain, const char *format, ...);
 
-#define log _log /* hack it so we don't conflict with log() as much */
-
 #if defined(_MSC_VER) && _MSC_VER < 1300
 /* MSVC 6 and earlier don't have __FUNCTION__, or even __LINE__. */
 #define log_fn _log_fn

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.h,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- util.h	25 Oct 2005 07:05:03 -0000	1.146
+++ util.h	25 Oct 2005 18:01:00 -0000	1.147
@@ -38,16 +38,6 @@
  */
 #error "Sorry; we don't support building with NDEBUG."
 #else
-#ifdef OLD_LOG_INTERFACE
-#define tor_assert(expr) do {                                           \
-    if (!(expr)) {                                                      \
-      log(LOG_ERR, "%s:%d: %s: Assertion %s failed; aborting.",         \
-          _SHORT_FILE_, __LINE__, __FUNCTION__, #expr);                 \
-      fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n",      \
-              _SHORT_FILE_, __LINE__, __FUNCTION__, #expr);             \
-      abort();  /* unreached */                                         \
-    } } while (0)
-#else
 #define tor_assert(expr) do {                                           \
     if (!(expr)) {                                                      \
       log(LOG_ERR, LD_BUG, "%s:%d: %s: Assertion %s failed; aborting.", \
@@ -57,7 +47,6 @@
       abort();  /* unreached */                                         \
     } } while (0)
 #endif
-#endif
 
 #ifdef USE_DMALLOC
 #define DMALLOC_PARAMS , const char *file, const int line



More information about the tor-commits mailing list