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