log.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * log.h
  3. * Logging facilities.
  4. *
  5. * Matej Pfajfar <mp292@cam.ac.uk>
  6. */
  7. /*
  8. * Changes :
  9. * $Log$
  10. * Revision 1.3 2003/05/09 02:41:27 nickm
  11. * One is the language; the other is the compiler
  12. *
  13. * Revision 1.2 2003/05/09 02:25:37 nickm
  14. * work on versioning; new log_fn function
  15. *
  16. * Revision 1.1.1.1 2002/06/26 22:45:50 arma
  17. * initial commit: current code
  18. *
  19. * Revision 1.5 2002/01/26 18:52:00 mp292
  20. * Reviewed according to Secure-Programs-HOWTO.
  21. *
  22. * Revision 1.4 2001/12/18 10:37:47 badbytes
  23. * Header files now only apply if they were not previously included from somewhere else.
  24. *
  25. * Revision 1.3 2001/12/07 09:38:03 badbytes
  26. * Tested.
  27. *
  28. * Revision 1.2 2001/12/06 15:43:50 badbytes
  29. * config.c compiles. Proceeding to test it.
  30. *
  31. * Revision 1.1 2001/11/21 23:03:41 mp292
  32. * log function coded and tested.
  33. * Top-level makefile.
  34. *
  35. */
  36. #ifndef __LOG_H
  37. #include <syslog.h>
  38. /* Outputs a message to stdout and also logs the same message using syslog. */
  39. void log(int severity, const char *format, ...);
  40. #ifdef __GNUC__
  41. #define log_fn(severity, format, args...) \
  42. log((severity), __PRETTY_FUNCTION__ # "(): " # format, ##args)
  43. #else
  44. #define log_fn log
  45. #endif
  46. # define __LOG_H
  47. #endif