aboutsummaryrefslogtreecommitdiff
path: root/src/lib/log/log.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-21 11:42:20 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 07:50:13 -0400
commitf4fc633937b56e52087c0e1c7a962a3a8cd7d2d4 (patch)
tree1fd97cfb0e671bad2e99aa4c88143a0b8b397302 /src/lib/log/log.h
parentac3136a6fb52500d849db7622b4af0af42038a91 (diff)
downloadtor-f4fc633937b56e52087c0e1c7a962a3a8cd7d2d4.tar.gz
tor-f4fc633937b56e52087c0e1c7a962a3a8cd7d2d4.zip
Make a pair of add_*_log() functions mockable.
Diffstat (limited to 'src/lib/log/log.h')
-rw-r--r--src/lib/log/log.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/log/log.h b/src/lib/log/log.h
index 4dead0fd2c..374db76e12 100644
--- a/src/lib/log/log.h
+++ b/src/lib/log/log.h
@@ -163,11 +163,11 @@ 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,
- int fd);
+void add_stream_log(const log_severity_list_t *severity,
+ const char *name, int fd);
+MOCK_DECL(int, add_file_log,(const log_severity_list_t *severity,
+ const char *filename,
+ int fd));
#ifdef HAVE_SYSLOG_H
int add_syslog_log(const log_severity_list_t *severity,
@@ -194,7 +194,7 @@ void change_callback_log_severity(int loglevelMin, int loglevelMax,
void flush_pending_log_callbacks(void);
void flush_log_messages_from_startup(void);
void log_set_application_name(const char *name);
-void set_log_time_granularity(int granularity_msec);
+MOCK_DECL(void, set_log_time_granularity,(int granularity_msec));
void truncate_logs(void);
void tor_log(int severity, log_domain_mask_t domain, const char *format, ...)
@@ -306,6 +306,8 @@ extern const log_domain_mask_t LD_GENERAL_;
MOCK_DECL(STATIC void, logv, (int severity, log_domain_mask_t domain,
const char *funcname, const char *suffix, const char *format,
va_list ap) CHECK_PRINTF(5,0));
+MOCK_DECL(STATIC void, add_stream_log_impl,(
+ const log_severity_list_t *severity, const char *name, int fd));
#endif
#if defined(LOG_PRIVATE) || defined(TOR_UNIT_TESTS)