00001 #ifndef ERRLOG_H_INCLUDED 00002 #define ERRLOG_H_INCLUDED 00003 #define ERRLOG_H_VERSION "$Id: errlog.h,v 2.1 2002/06/04 17:22:36 jongfoster Exp $" 00004 /* ****************************************************************** 00005 * $Source: /cvsroot/ijbswa/current/src/errlog.h,v $ 00006 * ****************************************************************** 00007 * 00008 * Written by and Copyright (C) 2001 the SourceForge 00009 * Privoxy team. http://www.privoxy.org/ 00010 * 00011 * Based on the Internet Junkbuster originally written 00012 * by and Copyright (C) 1997 Anonymous Coders and 00013 * Junkbusters Corporation. http://www.junkbusters.com 00014 * 00015 * This program is free software; you can redistribute it 00016 * and/or modify it under the terms of the GNU General 00017 * Public License as published by the Free Software 00018 * Foundation; either version 2 of the License, or (at 00019 * your option) any later version. 00020 * 00021 * This program is distributed in the hope that it will 00022 * be useful, but WITHOUT ANY WARRANTY; without even the 00023 * implied warranty of MERCHANTABILITY or FITNESS FOR A 00024 * PARTICULAR PURPOSE. See the GNU General Public 00025 * License for more details. 00026 * 00027 * The GNU General Public License should be included with 00028 * this file. If not, you can view it at 00029 * http://www.gnu.org/copyleft/gpl.html 00030 * or write to the Free Software Foundation, Inc., 59 00031 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00032 * 00033 * *****************************************************************/ 00034 /** 00035 * @file 00036 * 00037 * Log errors to a designated destination in an elegant, 00038 * printf-like fashion. 00039 * 00040 * 00041 * $Log: errlog.h,v $ 00042 * Revision 2.1 2002/06/04 17:22:36 jongfoster 00043 * Adding comments 00044 * 00045 * Revision 2.0 2002/06/04 14:34:21 jongfoster 00046 * Moving source files to src/ 00047 * 00048 * Revision 1.13 2002/03/26 22:29:54 swa 00049 * we have a new homepage! 00050 * 00051 * Revision 1.12 2002/03/24 13:25:43 swa 00052 * name change related issues 00053 * 00054 * Revision 1.11 2002/03/06 23:02:57 jongfoster 00055 * Removing tabs 00056 * 00057 * Revision 1.10 2001/09/13 20:08:06 jongfoster 00058 * Adding support for LOG_LEVEL_CGI 00059 * 00060 * Revision 1.9 2001/07/30 22:08:36 jongfoster 00061 * Tidying up #defines: 00062 * - All feature #defines are now of the form FEATURE_xxx 00063 * - Permanently turned off WIN_GUI_EDIT 00064 * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS 00065 * 00066 * Revision 1.8 2001/07/29 18:43:08 jongfoster 00067 * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to 00068 * ANSI C rules. 00069 * 00070 * Revision 1.7 2001/07/19 19:02:53 haroon 00071 * Added define for LOG_LEVEL_POPUPS 00072 * 00073 * Revision 1.6 2001/07/13 13:59:22 oes 00074 * - Added LOG_LEVEL_DEANIMATE 00075 * - Changed LOG_LEVEL_CLF 00076 * - Removed all #ifdef PCRS 00077 * 00078 * Revision 1.5 2001/05/26 17:25:14 jongfoster 00079 * Added support for CLF (Common Log Format) and fixed LOG_LEVEL_LOG 00080 * 00081 * Revision 1.4 2001/05/25 21:56:06 jongfoster 00082 * Added FIXME comment to (broken) LOG_LEVEL_LOG 00083 * 00084 * Revision 1.3 2001/05/22 18:46:04 oes 00085 * 00086 * - Enabled filtering banners by size rather than URL 00087 * by adding patterns that replace all standard banner 00088 * sizes with the "Junkbuster" gif to the re_filterfile 00089 * 00090 * - Enabled filtering WebBugs by providing a pattern 00091 * which kills all 1x1 images 00092 * 00093 * - Added support for PCRE_UNGREEDY behaviour to pcrs, 00094 * which is selected by the (nonstandard and therefore 00095 * capital) letter 'U' in the option string. 00096 * It causes the quantifiers to be ungreedy by default. 00097 * Appending a ? turns back to greedy (!). 00098 * 00099 * - Added a new interceptor ijb-send-banner, which 00100 * sends back the "Junkbuster" gif. Without imagelist or 00101 * MSIE detection support, or if tinygif = 1, or the 00102 * URL isn't recognized as an imageurl, a lame HTML 00103 * explanation is sent instead. 00104 * 00105 * - Added new feature, which permits blocking remote 00106 * script redirects and firing back a local redirect 00107 * to the browser. 00108 * The feature is conditionally compiled, i.e. it 00109 * can be disabled with --disable-fast-redirects, 00110 * plus it must be activated by a "fast-redirects" 00111 * line in the config file, has its own log level 00112 * and of course wants to be displayed by show-proxy-args 00113 * Note: Boy, all the #ifdefs in 1001 locations and 00114 * all the fumbling with configure.in and acconfig.h 00115 * were *way* more work than the feature itself :-( 00116 * 00117 * - Because a generic redirect template was needed for 00118 * this, tinygif = 3 now uses the same. 00119 * 00120 * - Moved GIFs, and other static HTTP response templates 00121 * to project.h 00122 * 00123 * - Some minor fixes 00124 * 00125 * - Removed some >400 CRs again (Jon, you really worked 00126 * a lot! ;-) 00127 * 00128 * Revision 1.2 2001/05/20 01:11:40 jongfoster 00129 * Added support for LOG_LEVEL_FATAL 00130 * Renamed LOG_LEVEL_FRC to LOG_LEVEL_FORCE, 00131 * and LOG_LEVEL_REF to LOG_LEVEL_RE_FILTER 00132 * 00133 * Revision 1.1.1.1 2001/05/15 13:58:51 oes 00134 * Initial import of version 2.9.3 source tree 00135 * 00136 * 00137 */ 00138 /* *****************************************************************/ 00139 00140 00141 #ifdef __cplusplus 00142 extern "C" { 00143 #endif 00144 00145 /* Debug level for errors */ 00146 00147 /** Log GET/POST/CONNECT requests. */ 00148 #define LOG_LEVEL_GPC 0x0001 00149 00150 /** Log connecting to the server. */ 00151 #define LOG_LEVEL_CONNECT 0x0002 00152 00153 /** Log ... what? FIXME. */ 00154 #define LOG_LEVEL_IO 0x0004 00155 00156 /** Log header parsing and modifying. */ 00157 #define LOG_LEVEL_HEADER 0x0008 00158 00159 /** Log ... what? FIXME. */ 00160 #define LOG_LEVEL_LOG 0x0010 00161 00162 #ifdef FEATURE_FORCE_LOAD 00163 /** Log forced page load feature. */ 00164 #define LOG_LEVEL_FORCE 0x0020 00165 #endif /* def FEATURE_FORCE_LOAD */ 00166 00167 /** Log PCRS feature. */ 00168 #define LOG_LEVEL_RE_FILTER 0x0040 00169 00170 #ifdef FEATURE_FAST_REDIRECTS 00171 /** Log fast redirects feature. */ 00172 #define LOG_LEVEL_REDIRECTS 0x0080 00173 #endif /* def FEATURE_FAST_REDIRECTS */ 00174 00175 /** Log GIF deanimation. */ 00176 #define LOG_LEVEL_DEANIMATE 0x0100 00177 00178 /** Log in Common Log File format. Note that for properly formatted log files 00179 you should disable all the other log settings. */ 00180 #define LOG_LEVEL_CLF 0x0200 00181 00182 /** Log popup-killing feature */ 00183 #ifdef FEATURE_KILL_POPUPS 00184 #define LOG_LEVEL_POPUPS 0x0400 00185 #endif /* def FEATURE_KILL_POPUPS */ 00186 00187 /** Log CGI and template handling features */ 00188 #define LOG_LEVEL_CGI 0x0800 00189 00190 /** Log informative messages (program version etc). */ 00191 #define LOG_LEVEL_INFO 0x1000 00192 00193 /** Log error messages. */ 00194 #define LOG_LEVEL_ERROR 0x2000 00195 00196 /** Write a message to the log and exit the program. */ 00197 #define LOG_LEVEL_FATAL 0x4000 00198 00199 extern void init_error_log(const char *prog_name, const char *logfname, int debuglevel); 00200 extern void log_error(int loglevel, char *fmt, ...); 00201 00202 /* Revision control strings from this header and associated .c file */ 00203 00204 /** Version information about errlog.c. */ 00205 extern const char errlog_rcs[]; 00206 00207 /** Version information about errlog.h. */ 00208 extern const char errlog_h_rcs[]; 00209 00210 #ifdef __cplusplus 00211 } /* extern "C" */ 00212 #endif 00213 00214 #endif /* ndef ERRLOG_H_INCLUDED */ 00215 00216 /* 00217 Local Variables: 00218 tab-width: 3 00219 end: 00220 */ 00221