1 #ifndef ERRLOG_H_INCLUDED
2 #define ERRLOG_H_INCLUDED
3 #define ERRLOG_H_VERSION "$Id: errlog.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
4 /*********************************************************************
6 * File : $Source: /cvsroot/ijbswa/current/src/errlog.h,v $
8 * Purpose : Log errors to a designated destination in an elegant,
11 * Copyright : Written by and Copyright (C) 2001 the SourceForge
12 * Privoxy team. http://www.privoxy.org/
14 * Based on the Internet Junkbuster originally written
15 * by and Copyright (C) 1997 Anonymous Coders and
16 * Junkbusters Corporation. http://www.junkbusters.com
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.
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.
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.
38 * Revision 2.0 2002/06/04 14:34:21 jongfoster
39 * Moving source files to src/
41 * Revision 1.13 2002/03/26 22:29:54 swa
42 * we have a new homepage!
44 * Revision 1.12 2002/03/24 13:25:43 swa
45 * name change related issues
47 * Revision 1.11 2002/03/06 23:02:57 jongfoster
50 * Revision 1.10 2001/09/13 20:08:06 jongfoster
51 * Adding support for LOG_LEVEL_CGI
53 * Revision 1.9 2001/07/30 22:08:36 jongfoster
54 * Tidying up #defines:
55 * - All feature #defines are now of the form FEATURE_xxx
56 * - Permanently turned off WIN_GUI_EDIT
57 * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
59 * Revision 1.8 2001/07/29 18:43:08 jongfoster
60 * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
63 * Revision 1.7 2001/07/19 19:02:53 haroon
64 * Added define for LOG_LEVEL_POPUPS
66 * Revision 1.6 2001/07/13 13:59:22 oes
67 * - Added LOG_LEVEL_DEANIMATE
68 * - Changed LOG_LEVEL_CLF
69 * - Removed all #ifdef PCRS
71 * Revision 1.5 2001/05/26 17:25:14 jongfoster
72 * Added support for CLF (Common Log Format) and fixed LOG_LEVEL_LOG
74 * Revision 1.4 2001/05/25 21:56:06 jongfoster
75 * Added FIXME comment to (broken) LOG_LEVEL_LOG
77 * Revision 1.3 2001/05/22 18:46:04 oes
79 * - Enabled filtering banners by size rather than URL
80 * by adding patterns that replace all standard banner
81 * sizes with the "Junkbuster" gif to the re_filterfile
83 * - Enabled filtering WebBugs by providing a pattern
84 * which kills all 1x1 images
86 * - Added support for PCRE_UNGREEDY behaviour to pcrs,
87 * which is selected by the (nonstandard and therefore
88 * capital) letter 'U' in the option string.
89 * It causes the quantifiers to be ungreedy by default.
90 * Appending a ? turns back to greedy (!).
92 * - Added a new interceptor ijb-send-banner, which
93 * sends back the "Junkbuster" gif. Without imagelist or
94 * MSIE detection support, or if tinygif = 1, or the
95 * URL isn't recognized as an imageurl, a lame HTML
96 * explanation is sent instead.
98 * - Added new feature, which permits blocking remote
99 * script redirects and firing back a local redirect
101 * The feature is conditionally compiled, i.e. it
102 * can be disabled with --disable-fast-redirects,
103 * plus it must be activated by a "fast-redirects"
104 * line in the config file, has its own log level
105 * and of course wants to be displayed by show-proxy-args
106 * Note: Boy, all the #ifdefs in 1001 locations and
107 * all the fumbling with configure.in and acconfig.h
108 * were *way* more work than the feature itself :-(
110 * - Because a generic redirect template was needed for
111 * this, tinygif = 3 now uses the same.
113 * - Moved GIFs, and other static HTTP response templates
118 * - Removed some >400 CRs again (Jon, you really worked
121 * Revision 1.2 2001/05/20 01:11:40 jongfoster
122 * Added support for LOG_LEVEL_FATAL
123 * Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE,
124 * and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER
126 * Revision 1.1.1.1 2001/05/15 13:58:51 oes
127 * Initial import of version 2.9.3 source tree
130 *********************************************************************/
137 /* Debug level for errors */
139 /** Log GET/POST/CONNECT requests. */
140 #define LOG_LEVEL_GPC 0x0001
142 /** Log connecting to the server. */
143 #define LOG_LEVEL_CONNECT 0x0002
145 /** Log ... what? FIXME. */
146 #define LOG_LEVEL_IO 0x0004
148 /** Log header parsing and modifying. */
149 #define LOG_LEVEL_HEADER 0x0008
151 /** Log ... what? FIXME. */
152 #define LOG_LEVEL_LOG 0x0010
154 #ifdef FEATURE_FORCE_LOAD
155 /** Log forced page load feature. */
156 #define LOG_LEVEL_FORCE 0x0020
157 #endif /* def FEATURE_FORCE_LOAD */
159 /** Log PCRS feature. */
160 #define LOG_LEVEL_RE_FILTER 0x0040
162 #ifdef FEATURE_FAST_REDIRECTS
163 /** Log fast redirects feature. */
164 #define LOG_LEVEL_REDIRECTS 0x0080
165 #endif /* def FEATURE_FAST_REDIRECTS */
167 /** Log GIF deanimation. */
168 #define LOG_LEVEL_DEANIMATE 0x0100
170 /** Log in Common Log File format. Note that for properly formatted log files
171 you should disable all the other log settings. */
172 #define LOG_LEVEL_CLF 0x0200
174 /** Log popup-killing feature */
175 #ifdef FEATURE_KILL_POPUPS
176 #define LOG_LEVEL_POPUPS 0x0400
177 #endif /* def FEATURE_KILL_POPUPS */
179 /** Log CGI and template handling features */
180 #define LOG_LEVEL_CGI 0x0800
182 /** Log informative messages (program version etc). */
183 #define LOG_LEVEL_INFO 0x1000
185 /** Log error messages. */
186 #define LOG_LEVEL_ERROR 0x2000
188 /** Write a message to the log and exit the program. */
189 #define LOG_LEVEL_FATAL 0x4000
191 extern void init_error_log(const char *prog_name, const char *logfname, int debuglevel);
192 extern void log_error(int loglevel, char *fmt, ...);
194 /* Revision control strings from this header and associated .c file */
195 extern const char errlog_rcs[];
196 extern const char errlog_h_rcs[];
202 #endif /* ndef ERRLOG_H_INCLUDED */