log.h 543 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__
Nick Mathewson's avatar
Nick Mathewson committed
16
17
18
#define log_fn(severity, format) \
  log((severity), "%s(): " format , __PRETTY_FUNCTION__)
#define log_fnf(severity, format, args...) \
19
  log((severity), "%s(): " format , __PRETTY_FUNCTION__ ,  ##args)
20
21
#else
#define log_fn log
Nick Mathewson's avatar
Nick Mathewson committed
22
#define log_fnf log
23
24
#endif

Roger Dingledine's avatar
Roger Dingledine committed
25
26
# define __LOG_H
#endif