libfuncs is collection of code (list, queue, circular buffer, io, logging, etc.). https://georgi.unixsol.org/programs/libfuncs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

log.h 760B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * LOG functions header file
  3. * Copyright (C) 2006 Unix Solutions Ltd.
  4. *
  5. * Released under MIT license.
  6. * See LICENSE-MIT.txt for license terms.
  7. */
  8. #ifndef LOG_H
  9. # define LOG_H
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include <stdio.h>
  14. void log_init (char *host_ident, int use_syslog, int use_stderr, char *log_host, int log_port);
  15. void log_close ();
  16. void LOG (const char *msg);
  17. __attribute__ ((format(printf, 1, 2)))
  18. void LOGf(const char *fmt, ...);
  19. void log_perror(const char *message, int _errno);
  20. void log_set_out_fd(FILE *new_out_fd);
  21. #ifdef DEBUG
  22. #define dbg_LOG LOG
  23. #define dbg_LOGf LOGf
  24. #else
  25. #define dbg_LOG(arg) do { /* arg */ } while(0)
  26. #define dbg_LOGf(...) do { /* ... */ } while(0)
  27. #endif
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif