[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [tor/master] Rename log.h to torlog.h
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri, 9 Jul 2010 21:52:20 -0400
Subject: Rename log.h to torlog.h
Commit: 14bc4dcc229fe45af48986820020779b440149cb
This should make us conflict less with system files named "log.h".
Yes, we shouldn't have been conflicting with those anyway, but some
people's compilers act very oddly.
The actual change was done with one "git mv", by editing
Makefile.am, and running
find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
---
changes/RemoveLogHeader | 4 +
src/common/Makefile.am | 2 +-
src/common/address.c | 2 +-
src/common/aes.c | 2 +-
src/common/compat.c | 2 +-
src/common/compat_libevent.c | 2 +-
src/common/container.c | 2 +-
src/common/crypto.c | 2 +-
src/common/log.c | 2 +-
src/common/log.h | 207 ------------------------------------------
src/common/memarea.c | 2 +-
src/common/mempool.c | 2 +-
src/common/torgzip.c | 2 +-
src/common/torlog.h | 207 ++++++++++++++++++++++++++++++++++++++++++
src/common/tortls.c | 2 +-
src/common/util.c | 2 +-
src/or/buffers.c | 2 +-
src/or/or.h | 2 +-
src/tools/tor-checkkey.c | 2 +-
src/tools/tor-gencert.c | 2 +-
src/tools/tor-resolve.c | 2 +-
21 files changed, 229 insertions(+), 225 deletions(-)
create mode 100644 changes/RemoveLogHeader
delete mode 100644 src/common/log.h
create mode 100644 src/common/torlog.h
diff --git a/changes/RemoveLogHeader b/changes/RemoveLogHeader
new file mode 100644
index 0000000..d93c9ff
--- /dev/null
+++ b/changes/RemoveLogHeader
@@ -0,0 +1,4 @@
+ o Code simplifications and refactoring:
+ - Rename the "log.h" header to "torlog.h" so as to conflict with fewer
+ system headers.
+
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index eecfeb8..b1e03cd 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -16,7 +16,7 @@ libor_a_SOURCES = address.c log.c util.c compat.c container.c mempool.c \
libor_crypto_a_SOURCES = crypto.c aes.c tortls.c torgzip.c
libor_event_a_SOURCES = compat_libevent.c
-noinst_HEADERS = address.h log.h crypto.h util.h compat.h aes.h torint.h tortls.h strlcpy.c strlcat.c torgzip.h container.h ht.h mempool.h memarea.h ciphers.inc compat_libevent.h tortls_states.h
+noinst_HEADERS = address.h torlog.h crypto.h util.h compat.h aes.h torint.h tortls.h strlcpy.c strlcat.c torgzip.h container.h ht.h mempool.h memarea.h ciphers.inc compat_libevent.h tortls_states.h
common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)
if test "@SHA1SUM@" != none; then \
diff --git a/src/common/address.c b/src/common/address.c
index 4569373..c35f04c 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -12,7 +12,7 @@
#include "compat.h"
#include "util.h"
#include "address.h"
-#include "log.h"
+#include "torlog.h"
#ifdef MS_WINDOWS
#include <process.h>
diff --git a/src/common/aes.c b/src/common/aes.c
index 2b6f023..a173283 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -21,7 +21,7 @@
#include "compat.h"
#include "aes.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
/* We have 3 strategies for getting AES: Via OpenSSL's AES_encrypt function,
* via OpenSSL's EVP_EncryptUpdate function, or via the built-in AES
diff --git a/src/common/compat.c b/src/common/compat.c
index 7b79c5c..ebe8c03 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -88,7 +88,7 @@
#include <sys/prctl.h>
#endif
-#include "log.h"
+#include "torlog.h"
#include "util.h"
#include "container.h"
#include "address.h"
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 1532392..5cdd687 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -15,7 +15,7 @@
#include "compat_libevent.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
#ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h>
diff --git a/src/common/container.c b/src/common/container.c
index ab5a9b0..72f3470 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -13,7 +13,7 @@
#include "compat.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
#include "container.h"
#include "crypto.h"
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 1d75555..bfb81d3 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -50,7 +50,7 @@
#define CRYPTO_PRIVATE
#include "crypto.h"
-#include "../common/log.h"
+#include "../common/torlog.h"
#include "aes.h"
#include "../common/util.h"
#include "container.h"
diff --git a/src/common/log.c b/src/common/log.c
index 6bf9472..b639e7a 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -33,7 +33,7 @@
#include "compat.h"
#include "util.h"
#define LOG_PRIVATE
-#include "log.h"
+#include "torlog.h"
#include "container.h"
#define TRUNCATED_STR "[...truncated]"
diff --git a/src/common/log.h b/src/common/log.h
deleted file mode 100644
index 2121956..0000000
--- a/src/common/log.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Copyright (c) 2001, Matej Pfajfar.
- * Copyright (c) 2001-2004, Roger Dingledine.
- * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2010, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file log.h
- *
- * \brief Headers for log.c
- **/
-
-#ifndef _TOR_LOG_H
-
-#include "compat.h"
-
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-#define LOG_WARN LOG_WARNING
-#if LOG_DEBUG < LOG_ERR
-#error "Your syslog.h thinks high numbers are more important. " \
- "We aren't prepared to deal with that."
-#endif
-#else
-/* Note: Syslog's logging code refers to priorities, with 0 being the most
- * important. Thus, all our comparisons needed to be reversed when we added
- * syslog support.
- *
- * The upshot of this is that comments about log levels may be messed up: for
- * "maximum severity" read "most severe" and "numerically *lowest* severity".
- */
-
-/** Debug-level severity: for hyper-verbose messages of no interest to
- * anybody but developers. */
-#define LOG_DEBUG 7
-/** Info-level severity: for messages that appear frequently during normal
- * operation. */
-#define LOG_INFO 6
-/** Notice-level severity: for messages that appear infrequently
- * during normal operation; that the user will probably care about;
- * and that are not errors.
- */
-#define LOG_NOTICE 5
-/** Warn-level severity: for messages that only appear when something has gone
- * wrong. */
-#define LOG_WARN 4
-/** Error-level severity: for messages that only appear when something has gone
- * very wrong, and the Tor process can no longer proceed. */
-#define LOG_ERR 3
-#endif
-
-/* Logging domains */
-
-/** Catch-all for miscellaneous events and fatal errors. */
-#define LD_GENERAL (1u<<0)
-/** The cryptography subsystem. */
-#define LD_CRYPTO (1u<<1)
-/** Networking. */
-#define LD_NET (1u<<2)
-/** Parsing and acting on our configuration. */
-#define LD_CONFIG (1u<<3)
-/** Reading and writing from the filesystem. */
-#define LD_FS (1u<<4)
-/** Other servers' (non)compliance with the Tor protocol. */
-#define LD_PROTOCOL (1u<<5)
-/** Memory management. */
-#define LD_MM (1u<<6)
-/** HTTP implementation. */
-#define LD_HTTP (1u<<7)
-/** Application (socks) requests. */
-#define LD_APP (1u<<8)
-/** Communication via the controller protocol. */
-#define LD_CONTROL (1u<<9)
-/** Building, using, and managing circuits. */
-#define LD_CIRC (1u<<10)
-/** Hidden services. */
-#define LD_REND (1u<<11)
-/** Internal errors in this Tor process. */
-#define LD_BUG (1u<<12)
-/** Learning and using information about Tor servers. */
-#define LD_DIR (1u<<13)
-/** Learning and using information about Tor servers. */
-#define LD_DIRSERV (1u<<14)
-/** Onion routing protocol. */
-#define LD_OR (1u<<15)
-/** Generic edge-connection functionality. */
-#define LD_EDGE (1u<<16)
-#define LD_EXIT LD_EDGE
-/** Bandwidth accounting. */
-#define LD_ACCT (1u<<17)
-/** Router history */
-#define LD_HIST (1u<<18)
-/** OR handshaking */
-#define LD_HANDSHAKE (1u<<19)
-/** Number of logging domains in the code. */
-#define N_LOGGING_DOMAINS 20
-
-typedef uint32_t log_domain_mask_t;
-
-/** Configures which severities are logged for each logging domain for a given
- * log target. */
-typedef struct log_severity_list_t {
- /** For each log severity, a bitmask of which domains a given logger is
- * logging. */
- log_domain_mask_t masks[LOG_DEBUG-LOG_ERR+1];
-} log_severity_list_t;
-
-#ifdef LOG_PRIVATE
-/** Given a severity, yields an index into log_severity_list_t.masks to use
- * for that severity. */
-#define SEVERITY_MASK_IDX(sev) ((sev) - LOG_ERR)
-#endif
-
-/** Callback type used for add_callback_log. */
-typedef void (*log_callback)(int severity, uint32_t domain, const char *msg);
-
-void init_logging(void);
-int parse_log_level(const char *level);
-const char *log_level_to_string(int level);
-int parse_log_severity_config(const char **cfg,
- log_severity_list_t *severity_out);
-void set_log_severity_config(int minSeverity, int maxSeverity,
- log_severity_list_t *severity_out);
-void add_stream_log(const log_severity_list_t *severity, const char *name,
- int fd);
-int add_file_log(const log_severity_list_t *severity, const char *filename);
-#ifdef HAVE_SYSLOG_H
-int add_syslog_log(const log_severity_list_t *severity);
-#endif
-int add_callback_log(const log_severity_list_t *severity, log_callback cb);
-int get_min_log_level(void);
-void switch_logs_debug(void);
-void logs_free_all(void);
-void add_temp_log(int min_severity);
-void close_temp_logs(void);
-void rollback_log_changes(void);
-void mark_logs_temp(void);
-void change_callback_log_severity(int loglevelMin, int loglevelMax,
- log_callback cb);
-void log_set_application_name(const char *name);
-
-/* Outputs a message to stdout */
-void tor_log(int severity, log_domain_mask_t domain, const char *format, ...)
- CHECK_PRINTF(3,4);
-#define log tor_log /* hack it so we don't conflict with log() as much */
-
-#ifdef __GNUC__
-extern int _log_global_min_severity;
-
-void _log_fn(int severity, log_domain_mask_t domain,
- const char *funcname, const char *format, ...)
- CHECK_PRINTF(4,5);
-/** Log a message at level <b>severity</b>, using a pretty-printed version
- * of the current function name. */
-#define log_fn(severity, domain, args...) \
- _log_fn(severity, domain, __PRETTY_FUNCTION__, args)
-#define log_debug(domain, args...) \
- STMT_BEGIN \
- if (PREDICT_UNLIKELY(_log_global_min_severity == LOG_DEBUG)) \
- _log_fn(LOG_DEBUG, domain, __PRETTY_FUNCTION__, args); \
- STMT_END
-#define log_info(domain, args...) \
- _log_fn(LOG_INFO, domain, __PRETTY_FUNCTION__, args)
-#define log_notice(domain, args...) \
- _log_fn(LOG_NOTICE, domain, __PRETTY_FUNCTION__, args)
-#define log_warn(domain, args...) \
- _log_fn(LOG_WARN, domain, __PRETTY_FUNCTION__, args)
-#define log_err(domain, args...) \
- _log_fn(LOG_ERR, domain, __PRETTY_FUNCTION__, args)
-
-#else /* ! defined(__GNUC__) */
-
-void _log_fn(int severity, log_domain_mask_t domain, const char *format, ...);
-void _log_debug(log_domain_mask_t domain, const char *format, ...);
-void _log_info(log_domain_mask_t domain, const char *format, ...);
-void _log_notice(log_domain_mask_t domain, const char *format, ...);
-void _log_warn(log_domain_mask_t domain, const char *format, ...);
-void _log_err(log_domain_mask_t domain, const char *format, ...);
-
-#if defined(_MSC_VER) && _MSC_VER < 1300
-/* MSVC 6 and earlier don't have __func__, 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
-#else
-/* We don't have GCC's varargs macros, so use a global variable to pass the
- * function name to log_fn */
-extern const char *_log_fn_function_name;
-/* We abuse the comma operator here, since we can't use the standard
- * do {...} while (0) trick to wrap this macro, since the macro can't take
- * arguments. */
-#define log_fn (_log_fn_function_name=__func__),_log_fn
-#define log_debug (_log_fn_function_name=__func__),_log_debug
-#define log_info (_log_fn_function_name=__func__),_log_info
-#define log_notice (_log_fn_function_name=__func__),_log_notice
-#define log_warn (_log_fn_function_name=__func__),_log_warn
-#define log_err (_log_fn_function_name=__func__),_log_err
-#endif
-
-#endif /* !GNUC */
-
-# define _TOR_LOG_H
-#endif
-
diff --git a/src/common/memarea.c b/src/common/memarea.c
index 0402e5f..77579e6 100644
--- a/src/common/memarea.c
+++ b/src/common/memarea.c
@@ -11,7 +11,7 @@
#include "memarea.h"
#include "util.h"
#include "compat.h"
-#include "log.h"
+#include "torlog.h"
/** If true, we try to detect any attempts to write beyond the length of a
* memarea. */
diff --git a/src/common/mempool.c b/src/common/mempool.c
index 256388a..c795d83 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -65,7 +65,7 @@
#include "orconfig.h"
#include "util.h"
#include "compat.h"
-#include "log.h"
+#include "torlog.h"
#define ALLOC(x) tor_malloc(x)
#define FREE(x) tor_free(x)
#define ASSERT(x) tor_assert(x)
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 9ebddf0..a247d6c 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -20,7 +20,7 @@
#include "torint.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
#include "torgzip.h"
/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of
diff --git a/src/common/torlog.h b/src/common/torlog.h
new file mode 100644
index 0000000..2121956
--- /dev/null
+++ b/src/common/torlog.h
@@ -0,0 +1,207 @@
+/* Copyright (c) 2001, Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2010, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file log.h
+ *
+ * \brief Headers for log.c
+ **/
+
+#ifndef _TOR_LOG_H
+
+#include "compat.h"
+
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#define LOG_WARN LOG_WARNING
+#if LOG_DEBUG < LOG_ERR
+#error "Your syslog.h thinks high numbers are more important. " \
+ "We aren't prepared to deal with that."
+#endif
+#else
+/* Note: Syslog's logging code refers to priorities, with 0 being the most
+ * important. Thus, all our comparisons needed to be reversed when we added
+ * syslog support.
+ *
+ * The upshot of this is that comments about log levels may be messed up: for
+ * "maximum severity" read "most severe" and "numerically *lowest* severity".
+ */
+
+/** Debug-level severity: for hyper-verbose messages of no interest to
+ * anybody but developers. */
+#define LOG_DEBUG 7
+/** Info-level severity: for messages that appear frequently during normal
+ * operation. */
+#define LOG_INFO 6
+/** Notice-level severity: for messages that appear infrequently
+ * during normal operation; that the user will probably care about;
+ * and that are not errors.
+ */
+#define LOG_NOTICE 5
+/** Warn-level severity: for messages that only appear when something has gone
+ * wrong. */
+#define LOG_WARN 4
+/** Error-level severity: for messages that only appear when something has gone
+ * very wrong, and the Tor process can no longer proceed. */
+#define LOG_ERR 3
+#endif
+
+/* Logging domains */
+
+/** Catch-all for miscellaneous events and fatal errors. */
+#define LD_GENERAL (1u<<0)
+/** The cryptography subsystem. */
+#define LD_CRYPTO (1u<<1)
+/** Networking. */
+#define LD_NET (1u<<2)
+/** Parsing and acting on our configuration. */
+#define LD_CONFIG (1u<<3)
+/** Reading and writing from the filesystem. */
+#define LD_FS (1u<<4)
+/** Other servers' (non)compliance with the Tor protocol. */
+#define LD_PROTOCOL (1u<<5)
+/** Memory management. */
+#define LD_MM (1u<<6)
+/** HTTP implementation. */
+#define LD_HTTP (1u<<7)
+/** Application (socks) requests. */
+#define LD_APP (1u<<8)
+/** Communication via the controller protocol. */
+#define LD_CONTROL (1u<<9)
+/** Building, using, and managing circuits. */
+#define LD_CIRC (1u<<10)
+/** Hidden services. */
+#define LD_REND (1u<<11)
+/** Internal errors in this Tor process. */
+#define LD_BUG (1u<<12)
+/** Learning and using information about Tor servers. */
+#define LD_DIR (1u<<13)
+/** Learning and using information about Tor servers. */
+#define LD_DIRSERV (1u<<14)
+/** Onion routing protocol. */
+#define LD_OR (1u<<15)
+/** Generic edge-connection functionality. */
+#define LD_EDGE (1u<<16)
+#define LD_EXIT LD_EDGE
+/** Bandwidth accounting. */
+#define LD_ACCT (1u<<17)
+/** Router history */
+#define LD_HIST (1u<<18)
+/** OR handshaking */
+#define LD_HANDSHAKE (1u<<19)
+/** Number of logging domains in the code. */
+#define N_LOGGING_DOMAINS 20
+
+typedef uint32_t log_domain_mask_t;
+
+/** Configures which severities are logged for each logging domain for a given
+ * log target. */
+typedef struct log_severity_list_t {
+ /** For each log severity, a bitmask of which domains a given logger is
+ * logging. */
+ log_domain_mask_t masks[LOG_DEBUG-LOG_ERR+1];
+} log_severity_list_t;
+
+#ifdef LOG_PRIVATE
+/** Given a severity, yields an index into log_severity_list_t.masks to use
+ * for that severity. */
+#define SEVERITY_MASK_IDX(sev) ((sev) - LOG_ERR)
+#endif
+
+/** Callback type used for add_callback_log. */
+typedef void (*log_callback)(int severity, uint32_t domain, const char *msg);
+
+void init_logging(void);
+int parse_log_level(const char *level);
+const char *log_level_to_string(int level);
+int parse_log_severity_config(const char **cfg,
+ log_severity_list_t *severity_out);
+void set_log_severity_config(int minSeverity, int maxSeverity,
+ log_severity_list_t *severity_out);
+void add_stream_log(const log_severity_list_t *severity, const char *name,
+ int fd);
+int add_file_log(const log_severity_list_t *severity, const char *filename);
+#ifdef HAVE_SYSLOG_H
+int add_syslog_log(const log_severity_list_t *severity);
+#endif
+int add_callback_log(const log_severity_list_t *severity, log_callback cb);
+int get_min_log_level(void);
+void switch_logs_debug(void);
+void logs_free_all(void);
+void add_temp_log(int min_severity);
+void close_temp_logs(void);
+void rollback_log_changes(void);
+void mark_logs_temp(void);
+void change_callback_log_severity(int loglevelMin, int loglevelMax,
+ log_callback cb);
+void log_set_application_name(const char *name);
+
+/* Outputs a message to stdout */
+void tor_log(int severity, log_domain_mask_t domain, const char *format, ...)
+ CHECK_PRINTF(3,4);
+#define log tor_log /* hack it so we don't conflict with log() as much */
+
+#ifdef __GNUC__
+extern int _log_global_min_severity;
+
+void _log_fn(int severity, log_domain_mask_t domain,
+ const char *funcname, const char *format, ...)
+ CHECK_PRINTF(4,5);
+/** Log a message at level <b>severity</b>, using a pretty-printed version
+ * of the current function name. */
+#define log_fn(severity, domain, args...) \
+ _log_fn(severity, domain, __PRETTY_FUNCTION__, args)
+#define log_debug(domain, args...) \
+ STMT_BEGIN \
+ if (PREDICT_UNLIKELY(_log_global_min_severity == LOG_DEBUG)) \
+ _log_fn(LOG_DEBUG, domain, __PRETTY_FUNCTION__, args); \
+ STMT_END
+#define log_info(domain, args...) \
+ _log_fn(LOG_INFO, domain, __PRETTY_FUNCTION__, args)
+#define log_notice(domain, args...) \
+ _log_fn(LOG_NOTICE, domain, __PRETTY_FUNCTION__, args)
+#define log_warn(domain, args...) \
+ _log_fn(LOG_WARN, domain, __PRETTY_FUNCTION__, args)
+#define log_err(domain, args...) \
+ _log_fn(LOG_ERR, domain, __PRETTY_FUNCTION__, args)
+
+#else /* ! defined(__GNUC__) */
+
+void _log_fn(int severity, log_domain_mask_t domain, const char *format, ...);
+void _log_debug(log_domain_mask_t domain, const char *format, ...);
+void _log_info(log_domain_mask_t domain, const char *format, ...);
+void _log_notice(log_domain_mask_t domain, const char *format, ...);
+void _log_warn(log_domain_mask_t domain, const char *format, ...);
+void _log_err(log_domain_mask_t domain, const char *format, ...);
+
+#if defined(_MSC_VER) && _MSC_VER < 1300
+/* MSVC 6 and earlier don't have __func__, 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
+#else
+/* We don't have GCC's varargs macros, so use a global variable to pass the
+ * function name to log_fn */
+extern const char *_log_fn_function_name;
+/* We abuse the comma operator here, since we can't use the standard
+ * do {...} while (0) trick to wrap this macro, since the macro can't take
+ * arguments. */
+#define log_fn (_log_fn_function_name=__func__),_log_fn
+#define log_debug (_log_fn_function_name=__func__),_log_debug
+#define log_info (_log_fn_function_name=__func__),_log_info
+#define log_notice (_log_fn_function_name=__func__),_log_notice
+#define log_warn (_log_fn_function_name=__func__),_log_warn
+#define log_err (_log_fn_function_name=__func__),_log_err
+#endif
+
+#endif /* !GNUC */
+
+# define _TOR_LOG_H
+#endif
+
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 6732d55..b3c91a6 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -38,7 +38,7 @@
#include "crypto.h"
#include "tortls.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
#include "container.h"
#include "ht.h"
#include <string.h>
diff --git a/src/common/util.c b/src/common/util.c
index 8531d12..6830ef3 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -15,7 +15,7 @@
#include "orconfig.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
#undef log
#include "crypto.h"
#include "torint.h"
diff --git a/src/or/buffers.c b/src/or/buffers.c
index 970c188..c4ebc81 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -13,7 +13,7 @@
#define BUFFERS_PRIVATE
#include "or.h"
#include "../common/util.h"
-#include "../common/log.h"
+#include "../common/torlog.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/or/or.h b/src/or/or.h
index 6098769..2124d45 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -82,7 +82,7 @@
#include "crypto.h"
#include "tortls.h"
-#include "../common/log.h"
+#include "../common/torlog.h"
#include "compat.h"
#include "container.h"
#include "util.h"
diff --git a/src/tools/tor-checkkey.c b/src/tools/tor-checkkey.c
index a244124..94c8cbd 100644
--- a/src/tools/tor-checkkey.c
+++ b/src/tools/tor-checkkey.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "crypto.h"
-#include "log.h"
+#include "torlog.h"
#include "../common/util.h"
#include "compat.h"
#include <openssl/bn.h>
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c
index 13a640c..bc99c24 100644
--- a/src/tools/tor-gencert.c
+++ b/src/tools/tor-gencert.c
@@ -29,7 +29,7 @@
#include "compat.h"
#include "../common/util.h"
-#include "../common/log.h"
+#include "../common/torlog.h"
#include "crypto.h"
#include "address.h"
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index 2639d9e..f5b0bec 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -8,7 +8,7 @@
#include "compat.h"
#include "../common/util.h"
#include "address.h"
-#include "../common/log.h"
+#include "../common/torlog.h"
#include <stdio.h>
#include <stdlib.h>
--
1.7.1