Now prints thread ID for each message (pthreads only)
[privoxy.git] / errlog.h
1 #ifndef _ERRLOG_H
2 #define _ERRLOG_H
3 #define ERRLOG_H_VERSION "$Id: errlog.h,v 1.6 2001/07/13 13:59:22 oes 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 the SourceForge
12  *                IJBSWA team.  http://ijbswa.sourceforge.net
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  * Revisions   :
37  *    $Log: errlog.h,v $
38  *    Revision 1.6  2001/07/13 13:59:22  oes
39  *     - Added LOG_LEVEL_DEANIMATE
40  *     - Changed LOG_LEVEL_CLF
41  *     - Removed all #ifdef PCRS
42  *
43  *    Revision 1.5  2001/05/26 17:25:14  jongfoster
44  *    Added support for CLF (Common Log Format) and fixed LOG_LEVEL_LOG
45  *
46  *    Revision 1.4  2001/05/25 21:56:06  jongfoster
47  *    Added FIXME comment to (broken) LOG_LEVEL_LOG
48  *
49  *    Revision 1.3  2001/05/22 18:46:04  oes
50  *
51  *    - Enabled filtering banners by size rather than URL
52  *      by adding patterns that replace all standard banner
53  *      sizes with the "Junkbuster" gif to the re_filterfile
54  *
55  *    - Enabled filtering WebBugs by providing a pattern
56  *      which kills all 1x1 images
57  *
58  *    - Added support for PCRE_UNGREEDY behaviour to pcrs,
59  *      which is selected by the (nonstandard and therefore
60  *      capital) letter 'U' in the option string.
61  *      It causes the quantifiers to be ungreedy by default.
62  *      Appending a ? turns back to greedy (!).
63  *
64  *    - Added a new interceptor ijb-send-banner, which
65  *      sends back the "Junkbuster" gif. Without imagelist or
66  *      MSIE detection support, or if tinygif = 1, or the
67  *      URL isn't recognized as an imageurl, a lame HTML
68  *      explanation is sent instead.
69  *
70  *    - Added new feature, which permits blocking remote
71  *      script redirects and firing back a local redirect
72  *      to the browser.
73  *      The feature is conditionally compiled, i.e. it
74  *      can be disabled with --disable-fast-redirects,
75  *      plus it must be activated by a "fast-redirects"
76  *      line in the config file, has its own log level
77  *      and of course wants to be displayed by show-proxy-args
78  *      Note: Boy, all the #ifdefs in 1001 locations and
79  *      all the fumbling with configure.in and acconfig.h
80  *      were *way* more work than the feature itself :-(
81  *
82  *    - Because a generic redirect template was needed for
83  *      this, tinygif = 3 now uses the same.
84  *
85  *    - Moved GIFs, and other static HTTP response templates
86  *      to project.h
87  *
88  *    - Some minor fixes
89  *
90  *    - Removed some >400 CRs again (Jon, you really worked
91  *      a lot! ;-)
92  *
93  *    Revision 1.2  2001/05/20 01:11:40  jongfoster
94  *    Added support for LOG_LEVEL_FATAL
95  *    Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE,
96  *    and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER
97  *
98  *    Revision 1.1.1.1  2001/05/15 13:58:51  oes
99  *    Initial import of version 2.9.3 source tree
100  *
101  *
102  *********************************************************************/
103 \f
104
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108
109 /* Debug level for errors */
110
111 #define LOG_LEVEL_GPC        0x0001
112 #define LOG_LEVEL_CONNECT    0x0002
113 #define LOG_LEVEL_IO         0x0004
114 #define LOG_LEVEL_HEADER     0x0008
115 #define LOG_LEVEL_LOG        0x0010
116 #ifdef FORCE_LOAD
117 #define LOG_LEVEL_FORCE      0x0020
118 #endif /* def FORCE_LOAD */
119 #define LOG_LEVEL_RE_FILTER  0x0040
120 #ifdef FAST_REDIRECTS
121 #define LOG_LEVEL_REDIRECTS  0x0080
122 #endif /* def FAST_REDIRECTS */
123 #define LOG_LEVEL_DEANIMATE  0x0100
124
125 #define LOG_LEVEL_CLF        0x0200 /* Common Log File format */
126 #ifdef KILLPOPUPS
127 #define LOG_LEVEL_POPUPS        0x0400 /* Kill Popups */
128 #endif /* def KILLPOPUPS */
129
130 /* Following are always on: */
131 #define LOG_LEVEL_INFO    0x1000
132 #define LOG_LEVEL_ERROR   0x2000
133 #define LOG_LEVEL_FATAL   0x4000 /* Exits after writing log */
134
135 extern void init_error_log(const char *prog_name, const char *logfname, int debuglevel);
136 extern void log_error(int loglevel, char *fmt, ...);
137
138 /* Revision control strings from this header and associated .c file */
139 extern const char errlog_rcs[];
140 extern const char errlog_h_rcs[];
141
142 #ifdef __cplusplus
143 } /* extern "C" */
144 #endif
145
146 #endif /* ndef _ERRLOG_H */
147
148 /*
149   Local Variables:
150   tab-width: 3
151   end:
152 */
153