Browse Source

Remove last vestiges of old logging interface.

svn:r5317
Nick Mathewson 18 years ago
parent
commit
5d85560d9e

+ 3 - 11
src/common/log.h

@@ -114,6 +114,7 @@ void change_callback_log_severity(int loglevelMin, int loglevelMax,
 
 /* 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 @@ void _log_fn(int severity, unsigned int domain,
   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 @@ void _log_fn(int severity, unsigned int domain,
   _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 _notice(unsigned int domain, const char *format, ...);
 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

+ 0 - 11
src/common/util.h

@@ -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

+ 0 - 1
src/or/buffers.c

@@ -12,7 +12,6 @@ const char buffers_c_id[] = "$Id$";
  * memory, file descriptors, or TLS connections.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 #define SENTINELS

+ 0 - 1
src/or/circuitbuild.c

@@ -10,7 +10,6 @@ const char circuitbuild_c_id[] = "$Id$";
  * \brief The actual details of building circuits.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /********* START VARIABLES **********/

+ 0 - 1
src/or/circuitlist.c

@@ -10,7 +10,6 @@ const char circuitlist_c_id[] = "$Id$";
  * \brief Manage the global circuit list.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /* Define RB_AUGMENT to avoid warnings about if statements with emtpy bodies.

+ 0 - 1
src/or/circuituse.c

@@ -10,7 +10,6 @@ const char circuituse_c_id[] = "$Id$";
  * \brief Launch the right sort of circuits and attach streams to them.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Longest time to wait for a circuit before closing an AP connection */

+ 0 - 1
src/or/command.c

@@ -16,7 +16,6 @@ const char command_c_id[] = "$Id$";
  *   connection_or_process_cells_from_inbuf() in connection_or.c
  */
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Keep statistics about how many of each type of cell we've received. */

+ 0 - 1
src/or/config.c

@@ -10,7 +10,6 @@ const char config_c_id[] = "$Id$";
  * \brief Code to parse and interpret configuration files.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 #ifdef MS_WINDOWS
 #include <shlobj.h>

+ 0 - 1
src/or/connection.c

@@ -11,7 +11,6 @@ const char connection_c_id[] = "$Id$";
  * on connections.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 static connection_t *connection_create_listener(const char *listenaddress,

+ 0 - 1
src/or/connection_edge.c

@@ -10,7 +10,6 @@ const char connection_edge_c_id[] = "$Id$";
  * \brief Handle edge streams.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 #include "tree.h"
 

+ 0 - 1
src/or/connection_or.c

@@ -11,7 +11,6 @@ const char connection_or_c_id[] = "$Id$";
  * cells on the network.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** How much clock skew do we tolerate when checking certificates for

+ 0 - 1
src/or/control.c

@@ -8,7 +8,6 @@ const char control_c_id[] = "$Id$";
  * \brief Implementation for Tor's control-socket interface.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 #define STATE_IS_OPEN(s) ((s) == CONTROL_CONN_STATE_OPEN_V0 ||       \

+ 0 - 1
src/or/cpuworker.c

@@ -13,7 +13,6 @@ const char cpuworker_c_id[] = "$Id$";
  * Right now, we only use this for processing onionskins.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** The maximum number of cpuworker processes we will keep around. */

+ 0 - 1
src/or/directory.c

@@ -4,7 +4,6 @@
 /* $Id$ */
 const char directory_c_id[] = "$Id$";
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /**

+ 0 - 1
src/or/dirserv.c

@@ -4,7 +4,6 @@
 /* $Id$ */
 const char dirserv_c_id[] = "$Id$";
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /**

+ 0 - 1
src/or/dns.c

@@ -17,7 +17,6 @@ const char dns_c_id[] = "$Id$";
  * them becomes more commonly available.
  */
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 #include "tree.h"
 

+ 0 - 1
src/or/hibernate.c

@@ -22,7 +22,6 @@ hibernating, phase 2:
   - close all OR/AP/exit conns)
 */
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 #define HIBERNATE_STATE_LIVE 1

+ 0 - 1
src/or/main.c

@@ -11,7 +11,6 @@ const char main_c_id[] = "$Id$";
  * connections, implements main loop, and drives scheduled events.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 #ifdef USE_DMALLOC
 #include <dmalloc.h>

+ 0 - 1
src/or/onion.c

@@ -11,7 +11,6 @@ const char onion_c_id[] = "$Id$";
  * parsing and creation.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Type for a linked list of circuits that are waiting for a free CPU worker

+ 0 - 3
src/or/or.h

@@ -133,9 +133,6 @@
 
 #include "../common/crypto.h"
 #include "../common/tortls.h"
-#ifndef NEW_LOG_INTERFACE
-#define OLD_LOG_INTERFACE
-#endif
 #include "../common/log.h"
 #include "../common/compat.h"
 #include "../common/container.h"

+ 0 - 1
src/or/relay.c

@@ -11,7 +11,6 @@ const char relay_c_id[] = "$Id$";
  * receiving from circuits.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 static int relay_crypt(circuit_t *circ, cell_t *cell, int cell_direction,

+ 0 - 1
src/or/rendclient.c

@@ -8,7 +8,6 @@ const char rendclient_c_id[] = "$Id$";
  * \brief Client code to access location-hidden services.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Called when we've established a circuit to an introduction point:

+ 0 - 1
src/or/rendcommon.c

@@ -9,7 +9,6 @@ const char rendcommon_c_id[] = "$Id$";
  * introducers, services, clients, and rendezvous points.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Return 0 if one and two are the same service ids, else -1 or 1 */

+ 0 - 1
src/or/rendmid.c

@@ -8,7 +8,6 @@ const char rendmid_c_id[] = "$Id$";
  * \brief Implement introductions points and rendezvous points.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /** Respond to an ESTABLISH_INTRO cell by checking the signed data and

+ 0 - 1
src/or/rendservice.c

@@ -8,7 +8,6 @@ const char rendservice_c_id[] = "$Id$";
  * \brief The hidden-service side of rendezvous functionality.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 static circuit_t *find_intro_circuit(routerinfo_t *router, const char *pk_digest);

+ 0 - 1
src/or/rephist.c

@@ -10,7 +10,6 @@ const char rephist_c_id[] = "$Id$";
  *    been using, which ports we tend to want, and so on.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 static void bw_arrays_init(void);

+ 0 - 1
src/or/router.c

@@ -5,7 +5,6 @@
 /* $Id$ */
 const char router_c_id[] = "$Id$";
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /**

+ 0 - 1
src/or/routerlist.c

@@ -12,7 +12,6 @@ const char routerlist_c_id[] = "$Id$";
  * servers.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /****************************************************************************/

+ 0 - 1
src/or/routerparse.c

@@ -10,7 +10,6 @@ const char routerparse_c_id[] = "$Id$";
  * \brief Code to parse and validate router descriptors and directories.
  **/
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 
 /****************************************************************************/

+ 0 - 1
src/or/test.c

@@ -22,7 +22,6 @@ const char test_c_id[] = "$Id$";
 #include <dirent.h>
 #endif
 
-#define NEW_LOG_INTERFACE
 #include "or.h"
 #include "../common/test.h"
 #include "../common/torgzip.h"