Commit 5d85560d authored by Nick Mathewson's avatar Nick Mathewson 🌉
Browse files

Remove last vestiges of old logging interface.


svn:r5317
parent d7e13624
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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 **********/
......
......@@ -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.
......
......@@ -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 */
......
......@@ -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. */
......
......@@ -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>
......
......@@ -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,
......
......@@ -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"
......
......@@ -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
......
......@@ -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 || \
......
......@@ -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. */
......
......@@ -4,7 +4,6 @@
/* $Id$ */
const char directory_c_id[] = "$Id$";
#define NEW_LOG_INTERFACE
#include "or.h"
/**
......
......@@ -4,7 +4,6 @@
/* $Id$ */
const char dirserv_c_id[] = "$Id$";
#define NEW_LOG_INTERFACE
#include "or.h"
/**
......
......@@ -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"
......
......@@ -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
......
......@@ -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>
......
......@@ -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
......
......@@ -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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment