errlog.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef ERRLOG_H_INCLUDED
  2. #define ERRLOG_H_INCLUDED
  3. /*********************************************************************
  4. *
  5. * File : $Source: /cvsroot/ijbswa/current/errlog.h,v $
  6. *
  7. * Purpose : Log errors to a designated destination in an elegant,
  8. * printf-like fashion.
  9. *
  10. * Copyright : Written by and Copyright (C) 2001-2009 members of the
  11. * Privoxy team. https://www.privoxy.org/
  12. *
  13. * Based on the Internet Junkbuster originally written
  14. * by and Copyright (C) 1997 Anonymous Coders and
  15. * Junkbusters Corporation. http://www.junkbusters.com
  16. *
  17. * This program is free software; you can redistribute it
  18. * and/or modify it under the terms of the GNU General
  19. * Public License as published by the Free Software
  20. * Foundation; either version 2 of the License, or (at
  21. * your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will
  24. * be useful, but WITHOUT ANY WARRANTY; without even the
  25. * implied warranty of MERCHANTABILITY or FITNESS FOR A
  26. * PARTICULAR PURPOSE. See the GNU General Public
  27. * License for more details.
  28. *
  29. * The GNU General Public License should be included with
  30. * this file. If not, you can view it at
  31. * http://www.gnu.org/copyleft/gpl.html
  32. * or write to the Free Software Foundation, Inc., 59
  33. * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  34. *
  35. *********************************************************************/
  36. /* Debug level for errors */
  37. #define LOG_LEVEL_REQUEST 0x0001
  38. #define LOG_LEVEL_CONNECT 0x0002
  39. #define LOG_LEVEL_IO 0x0004
  40. #define LOG_LEVEL_HEADER 0x0008
  41. #define LOG_LEVEL_WRITING 0x0010
  42. #ifdef FEATURE_FORCE_LOAD
  43. #define LOG_LEVEL_FORCE 0x0020
  44. #endif /* def FEATURE_FORCE_LOAD */
  45. #define LOG_LEVEL_RE_FILTER 0x0040
  46. #define LOG_LEVEL_REDIRECTS 0x0080
  47. #define LOG_LEVEL_DEANIMATE 0x0100
  48. #define LOG_LEVEL_CLF 0x0200 /* Common Log File format */
  49. #define LOG_LEVEL_CRUNCH 0x0400
  50. #define LOG_LEVEL_CGI 0x0800 /* CGI / templates */
  51. #define LOG_LEVEL_RECEIVED 0x8000
  52. #define LOG_LEVEL_ACTIONS 0x10000
  53. #ifdef FUZZ
  54. /*
  55. * Permanently disables logging through log_error().
  56. * Useful to reduce pointless overhead when fuzzing
  57. * without watching stdout.
  58. */
  59. #define LOG_LEVEL_STFU 0x20000
  60. #endif
  61. /* Following are always on: */
  62. #define LOG_LEVEL_INFO 0x1000
  63. #define LOG_LEVEL_ERROR 0x2000
  64. #define LOG_LEVEL_FATAL 0x4000 /* Exits after writing log */
  65. extern void init_error_log(const char *prog_name, const char *logfname);
  66. extern void set_debug_level(int debuglevel);
  67. extern int debug_level_is_enabled(int debuglevel);
  68. extern void disable_logging(void);
  69. extern void init_log_module(void);
  70. extern void show_version(const char *prog_name);
  71. extern void log_error(int loglevel, const char *fmt, ...);
  72. extern const char *jb_err_to_string(jb_err jb_error);
  73. #endif /* ndef ERRLOG_H_INCLUDED */
  74. /*
  75. Local Variables:
  76. tab-width: 3
  77. end:
  78. */