log.h 569 Bytes
Newer Older
Roger Dingledine's avatar
Roger Dingledine committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * log.h
 * Logging facilities.
 * 
 * Matej Pfajfar <mp292@cam.ac.uk>
 */

#ifndef __LOG_H

#include <syslog.h>

/* Outputs a message to stdout and also logs the same message using syslog. */
void log(int severity, const char *format, ...);

15
#ifdef __GNUC__
16
17
18
19
20
21
22
#ifdef __APPLE_CPP__
#define log_fn(severity, args...) \
  log((severity), __PRETTY_FUNCTION__ "(): " args)
#else
#define log_fn(severity, format, args...) \
  log((severity), "%s(): " format, __PRETTY_FUNCTION__ , ##args)
#endif
23
24
#else
#define log_fn log
Nick Mathewson's avatar
Nick Mathewson committed
25
#define log_fnf log
26
27
#endif

Roger Dingledine's avatar
Roger Dingledine committed
28
29
# define __LOG_H
#endif