libs-gsweb/GSWeb.framework/GSWDebug.h
Manuel Guesdon ce2a032367 2000-03-20 Manuel Guesdon <mguesdon@sbuilders.com>
* GSWDebug.h: remove unused functions
        * GSWApplication.h/.m:Added:
                GSWDebuggingStatus category
                +isStatusDebuggingEnabled
                +setStatusDebuggingEnabled:
                +debugSetConfigFilePath
                +setDebugSetConfigFilePath:
        * GSWApplication.h/.m:  replaced GSWDebugStdLog by [GSWApp statusDebug...]
                replaced executeWithClasses: with executeWithClassArray:
                corrections for different warnings
                change in GSWApplicationDebugSetChange() to use GSWDebugSetConfigFi
lePath option
        * GSWConfig.h: added GSWOPTVALUE_StatusDebuggingEnabled
        * GSWConstants.h/.m: added GSWOPT_StatusDebuggingEnabled
                added GSWOPT_DebugSetConfigFilePath
        * INSTALL: reflect changes of adaptors,...
        * GSWUtil.h/.m: corrections for different warnings
                removed MD5HexDigest()
        * GSWCheckBoxListm: replaced LOGAssertGood by GSWLogAssertGood
        * GSWRadioButtonList.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWDefaultAdaptorThread.m: replaced GSWLogCStdOut by +statusLogWithFormat
:
                corrections for different warnings
        * GSWDefaultAdaptor.m: replaced GSWLogCStdOut by +statusLogWithFormat:
        * GSWSessionTimeOutManager.m: replaced GSWLogCStdOut by +statusLogWithForma
t:
        * GSWKeyValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWHTMLStaticElement.m: corrections for different warnings
        * GSWConstantValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWHTMLDynamicElement.m: corrections for different warnings
        * GSWStatsPage.m: corrections for different warnings
        * GSWExceptionPage.m: removed GSWLogCStdOut calls
        * GSWSession.m: replaced GSWLogCStdOut by +statusLogWithFormat:
                replaced LOGAssertGood by GSWLogAssertGood
        * GSWAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWComponent.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWContext.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWRequest.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWResponse.m: replaced LOGAssertGood by GSWLogAssertGood
        * GSWSessionStore.m: replaced LOGAssertGood by GSWLogAssertGood
        * Adator GSWAppRequest.c: test on instance in GSWAppRequest_SendAppRequestT
oApp
        * Adator GSWLoadBalancing.c: added debug messages
        * Adaptor GSWHTTPRequest.c: corrected bug in GSWHTTPRequest_SendRequest
        * Adaptor: GSWAppConnectSocket.c: added debug messages
        * GSWeb.framework/Makefile.preamble: removed -lNGReflection


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@6345 72102866-910b-0410-8b05-ffd578937521
2000-03-20 15:50:51 +00:00

246 lines
9.6 KiB
C

/* debug.h - debug
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
This file is part of the GNUstep Web Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// $Id$
#ifndef _GSWebDebug_h__
#define _GSWebDebug_h__
#ifdef DEBUG
extern void GSWLogC_(CONST char* file,int line,CONST char* string);
extern void GSWLogDumpObject_(CONST char* file,int line,id object,int deep);
extern void GSWLogAssertGood_(CONST char* file,int line,NSObject* object);
#define GSWLogC(cString); GSWLogC_(__FILE__,__LINE__,cString);
#define GSWLogDumpObject(object,deep); GSWLogDumpObject_(__FILE__,__LINE__,object,deep);
#define GSWLogAssertGood(object); GSWLogAssertGood_(__FILE__,__LINE__,object);
#else
#define GSWLogC(cString);
#define GSWLogDumpObject(object,deep);
#define GSWLogAssertGood(object);
#endif
#ifdef DEBUG
#define LOGClassFnStart() \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
NSLog(fmt); }} while (0)
#define LOGClassFnStop() \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__,__FILE__, __LINE__,@"FNSTOP"); \
NSLog(fmt); }} while (0)
#define LOGClassFnStartC(comment) \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGClassFnStopC(comment) \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTOP %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGClassFnStartCond(cond) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
NSLog(fmt); }} while (0)
#define LOGClassFnStopCond(cond) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTOP"); \
NSLog(fmt); }} while (0)
#define LOGClassFnStartCondC(cond,comment) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGClassFnStopCondC(cond,comment) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTOP %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGObjectFnStart() \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
NSLog(fmt); }} while (0)
#define LOGObjectFnStop() \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
NSLog(fmt); }} while (0)
#define LOGObjectFnStartC(comment) \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGObjectFnStopC(comment) \
do { if (GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGObjectFnStartCond(cond) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
NSLog(fmt); }} while (0)
#define LOGObjectFnStopCond(cond) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
NSLog(fmt); }} while (0)
#define LOGObjectFnStartCondC(cond,comment) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGObjectFnStopCondC(cond,comment) \
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
NSLog(fmt,comment); }} while (0)
#define LOGObjectFnNotImplemented() \
do { if (GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
NSLog(fmt); }} while (0)
#define LOGClassFnNotImplemented() \
do { if (GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
NSLog(fmt); }} while (0)
#define LOGClassFnNotImplemented() \
do { if (GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
NSLog(fmt); }} while (0)
#define LOGSeriousError(format, args...) \
do { if (GSDebugSet(@"seriousError") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*SERIOUS ERROR*: %@",fmt]; \
NSLog(fmt2, ## args); }} while (0)
#define LOGSeriousError0(format) \
do { if (GSDebugSet(@"seriousError") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*SERIOUS ERROR*: %@",fmt]; \
NSLog(@"%@",fmt2); }} while (0)
#define LOGException(format, args...) \
do { if (GSDebugSet(@"exception") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
NSLog(fmt2, ## args); }} while (0)
#define LOGException0(format) \
do { if (GSDebugSet(@"exception") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
NSLog(@"%@",fmt2); }} while (0)
#define LOGError(format, args...) \
do { if (GSDebugSet(@"error") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*ERROR*: %@",fmt]; \
NSLog(fmt2, ## args);}} while (0)
#define LOGError0(format) \
do { if (GSDebugSet(@"error") == YES) { \
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
NSString *fmt2 = [NSString stringWithFormat:@"*ERROR*: %@",fmt]; \
NSLog(@"%@",fmt2); }} while (0)
#define NSDebugMLLogCond(cond, level, format, args...) \
do { if (cond && GSDebugSet(level) == YES) { \
NSString *fmt = GSDebugMethodMsg( \
self, _cmd, __FILE__, __LINE__, format); \
NSLog(fmt, ## args); }} while (0)
#define NSDebugMLogCond(cond, format, args...) \
do { if (cond && GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugMethodMsg( \
self, _cmd, __FILE__, __LINE__, format); \
NSLog(fmt, ## args); }} while (0)
#define NSDebugMLog0(format) \
do { if (GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugMethodMsg( \
self, _cmd, __FILE__, __LINE__, format); \
NSLog(fmt); }} while (0)
#define NSDebugMLLog0(level,format) \
do { if (GSDebugSet(level) == YES) { \
NSString *fmt = GSDebugMethodMsg( \
self, _cmd, __FILE__, __LINE__, format); \
NSLog(fmt); }} while (0)
#define NSDebugFLog0(format) \
do { if (GSDebugSet(@"dflt") == YES) { \
NSString *fmt = GSDebugFunctionMsg( \
__PRETTY_FUNCTION__, __FILE__, __LINE__, format); \
NSLog(fmt); }} while (0)
#define NSDebugFLLog0(level,format) \
do { if (GSDebugSet(level) == YES) { \
NSString *fmt = GSDebugFunctionMsg( \
__PRETTY_FUNCTION__, __FILE__, __LINE__, format); \
NSLog(fmt); }} while (0)
#else
#define LOGClassFnStart() {}
#define LOGClassFnStop() {}
#define LOGClassFnStartC(comment) {}
#define LOGClassFnStopC(comment) {}
#define LOGClassFnStartCond(cond) {}
#define LOGClassFnStopCond(cond) {}
#define LOGClassFnStartCondC(cond,comment) {}
#define LOGClassFnStopCondC(cond,comment) {}
#define LOGClassFnNotImplemented() {}
#define LOGObjectFnStart() {}
#define LOGObjectFnStop() {}
#define LOGObjectFnStartC(comment) {}
#define LOGObjectFnStopC(comment) {}
#define LOGObjectFnStartCond(cond) {}
#define LOGObjectFnStopCond(cond) {}
#define LOGObjectFnStartCondC(cond,comment) {}
#define LOGObjectFnStopCondC(cond,comment) {}
#define LOGObjectFnNotImplemented() {}
#define LOGSeriousError(format, args...) {}
#define LOGSeriousError0(format) {}
#define LOGError(format, args...) {}
#define LOGError0(format) {}
#define LOGException(format, args...) {}
#define LOGException0(format) {}
#define NSDebugMLog0(format) {}
#define NSDebugMLLog0(level,format) {}
#define NSDebugFLog0(format) {}
#define NSDebugFLLog0(level,format) {}
#define NSDebugMLLogCond(cond, level, format, args...) {}
#define NSDebugMLogCond(cond, format, args...) {}
#endif
#endif // _GSWebDebug_h__