frontierdebug.h

Go to the documentation of this file.
00001 
00002 /*  $Id: frontierdebug.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 /* targets: none, about window, log file, modal dialog, debugger */
00029 
00030 #define LAND_LOGTARGET_NONE         0
00031 #define LAND_LOGTARGET_ABOUT        1
00032 #define LAND_LOGTARGET_FILE         2
00033 #define LAND_LOGTARGET_DIALOG       4
00034 #define LAND_LOGTARGET_DEBUGGER     8
00035 
00036 
00037 /* levels: off, everything, medium, low */
00038 
00039 #define LAND_LOGLEVEL_OFF   0
00040 #define LAND_LOGLEVEL_1     1
00041 #define LAND_LOGLEVEL_2     2
00042 #define LAND_LOGLEVEL_3     3
00043 
00044 
00045 /* configuration for categories */
00046 
00047 #define LAND_TCPLOG_NAME    "tcp"
00048 #define LAND_TCPLOG_LEVEL   LAND_LOGLEVEL_OFF
00049 #define LAND_TCPLOG_TARGET  LAND_LOGTARGET_NONE
00050 
00051 #define LAND_DBLOG_NAME     "db"
00052 #define LAND_DBLOG_LEVEL    LAND_LOGLEVEL_OFF
00053 #define LAND_DBLOG_TARGET   LAND_LOGTARGET_NONE
00054 
00055 #define LAND_THREADSLOG_NAME        "threads"
00056 #define LAND_THREADSLOG_LEVEL       LAND_LOGLEVEL_OFF
00057 #define LAND_THREADSLOG_TARGET      LAND_LOGTARGET_NONE
00058 
00059 #define LAND_GENERALLOG_NAME        "general"
00060 #define LAND_GENERALLOG_LEVEL       LAND_LOGLEVEL_OFF
00061 #define LAND_GENERALLOG_TARGET      LAND_LOGTARGET_NONE
00062 
00063 
00064 /* basic definitions */
00065 
00066 #define LAND_MSG(m, t, n)       logmessage ((m), __FILE__, __LINE__, (t), (n))
00067 #define LAND_ASSERT(e, t, n)    ((void) ((e) ? 0 : (logassert ((#e), __FILE__, __LINE__, (t), (n))))
00068 
00069 
00070 /* definitions for GENERAL category */
00071 
00072 #if (LAND_GENERALLOG_LEVEL >= LAND_LOGLEVEL_1)
00073     #define MSG_1(x)        LAND_MSG((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME)
00074     #define ASSERT_1(x)     LAND_ASSERT((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME))
00075 #else
00076     #define MSG_1(x)
00077     #define ASSERT_1(x)
00078 #endif
00079 
00080 #if (LAND_GENERALLOG_LEVEL >= LAND_LOGLEVEL_2)
00081     #define MSG_2(x)        LAND_MSG((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME)
00082     #define ASSERT_2(x)     LAND_ASSERT((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME))
00083 #else
00084     #define MSG_2(x)
00085     #define ASSERT_2(x)
00086 #endif
00087 
00088 #if (LAND_GENERALLOG_LEVEL >= LAND_LOGLEVEL_3)
00089     #define MSG_3(x)        LAND_MSG((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME)
00090     #define ASSERT_3(x)     LAND_ASSERT((x), LAND_GENERALLOG_TARGET, LAND_GENERALLOG_NAME))
00091 #else
00092     #define MSG_3(x)
00093     #define ASSERT_3(x)
00094 #endif
00095 
00096 
00097 /* definitions for TCP category */
00098 
00099 #if (LAND_TCPLOG_LEVEL >= LAND_LOGLEVEL_1)
00100     #define TCP_MSG_1(x)        LAND_MSG((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME)
00101     #define TCP_ASSERT_1(x)     LAND_ASSERT((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME))
00102 #else
00103     #define TCP_MSG_1(x)
00104     #define TCP_ASSERT_1(x)
00105 #endif
00106 
00107 #if (LAND_TCPLOG_LEVEL >= LAND_LOGLEVEL_2)
00108     #define TCP_MSG_2(x)        LAND_MSG((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME)
00109     #define TCP_ASSERT_2(x)     LAND_ASSERT((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME))
00110 #else
00111     #define TCP_MSG_2(x)
00112     #define TCP_ASSERT_2(x)
00113 #endif
00114 
00115 #if (LAND_TCPLOG_LEVEL >= LAND_LOGLEVEL_3)
00116     #define TCP_MSG_3(x)        LAND_MSG((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME)
00117     #define TCP_ASSERT_3(x)     LAND_ASSERT((x), LAND_TCPLOG_TARGET, LAND_TCPLOG_NAME))
00118 #else
00119     #define TCP_MSG_3(x)
00120     #define TCP_ASSERT_3(x)
00121 #endif
00122 
00123 
00124 /* definitions for DB category */
00125 
00126 #if (LAND_DBLOG_LEVEL >= LAND_LOGLEVEL_1)
00127     #define DB_MSG_1(x)     LAND_MSG((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME)
00128     #define DB_ASSERT_1(x)      LAND_ASSERT((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME))
00129 #else
00130     #define DB_MSG_1(x)
00131     #define DB_ASSERT_1(x)
00132 #endif
00133 
00134 #if (LAND_DBLOG_LEVEL >= LAND_LOGLEVEL_2)
00135     #define DB_MSG_2(x)     LAND_MSG((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME)
00136     #define DB_ASSERT_2(x)      LAND_ASSERT((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME))
00137 #else
00138     #define DB_MSG_2(x)
00139     #define DB_ASSERT_2(x)
00140 #endif
00141 
00142 #if (LAND_DBLOG_LEVEL >= LAND_LOGLEVEL_3)
00143     #define DB_MSG_3(x)     LAND_MSG((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME)
00144     #define DB_ASSERT_3(x)      LAND_ASSERT((x), LAND_DBLOG_TARGET, LAND_DBLOG_NAME))
00145 #else
00146     #define DB_MSG_3(x)
00147     #define DB_ASSERT_3(x)
00148 #endif
00149 
00150 
00151 /* definitions for THREADS category */
00152 
00153 #if (LAND_THREADSLOG_LEVEL >= LAND_LOGLEVEL_1)
00154     #define THREADS_MSG_1(x)        LAND_MSG((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME)
00155     #define THREADS_ASSERT_1(x)     LAND_ASSERT((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME))
00156 #else
00157     #define THREADS_MSG_1(x)
00158     #define THREADS_ASSERT_1(x)
00159 #endif
00160 
00161 #if (LAND_THREADSLOG_LEVEL >= LAND_LOGLEVEL_2)
00162     #define THREADS_MSG_2(x)        LAND_MSG((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME)
00163     #define THREADS_ASSERT_2(x)     LAND_ASSERT((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME))
00164 #else
00165     #define THREADS_MSG_2(x)
00166     #define THREADS_ASSERT_2(x)
00167 #endif
00168 
00169 #if (LAND_THREADSLOG_LEVEL >= LAND_LOGLEVEL_3)
00170     #define THREADS_MSG_3(x)        LAND_MSG((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME)
00171     #define THREADS_ASSERT_3(x)     LAND_ASSERT((x), LAND_THREADSLOG_TARGET, LAND_THREADSLOG_NAME))
00172 #else
00173     #define THREADS_MSG_3(x)
00174     #define THREADS_ASSERT_3(x)
00175 #endif
00176 
00177 
00178 /* function templates */
00179 
00180 extern void logmessage (char *, char *, long, long, char *);
00181 
00182 extern long logassert (char *, char *, long, long, char *);
00183 
00184 extern void logstartup (void);
00185 
00186 extern void logshutdown (void);
00187 

Generated on Wed May 31 18:19:47 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6