log.h 430 B

1234567891011121314151617181920212223
  1. /*
  2. * log.h
  3. * Logging facilities.
  4. *
  5. * Matej Pfajfar <mp292@cam.ac.uk>
  6. */
  7. #ifndef __LOG_H
  8. #include <syslog.h>
  9. /* Outputs a message to stdout and also logs the same message using syslog. */
  10. void log(int severity, const char *format, ...);
  11. #ifdef __GNUC__
  12. #define log_fn(severity, format, args...) \
  13. log((severity), "%s(): " format , __PRETTY_FUNCTION__ , ##args)
  14. #else
  15. #define log_fn log
  16. #endif
  17. # define __LOG_H
  18. #endif