From 186099dd2738017bd8ed84aa0e8db598b7db96bd Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 4 Apr 2005 21:48:13 +0000 Subject: [PATCH] fixed logging bug git-svn-id: http://svn.opengroupware.org/SOPE/trunk@710 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 5 ++ .../NGHttp/NGHttp.xcode/project.pbxproj | 2 +- .../NGObjWeb/NGObjWeb.xcode/project.pbxproj | 4 +- .../SoObjects/SoObjectRequestHandler.m | 49 +++++++++++-------- .../SoObjects/SoObjects.xcode/project.pbxproj | 2 +- sope-appserver/NGObjWeb/Version | 2 +- .../WebDAV/WebDAV.xcode/project.pbxproj | 2 +- 7 files changed, 39 insertions(+), 27 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 96ce32c2..d8b90510 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,8 @@ +2005-04-04 Marcus Mueller + + * SoObjects/SoObjectRequestHandler.m: properly setup NGLogging so + logging works again. (v4.5.148) + 2005-03-31 Helge Hess * v4.5.147 diff --git a/sope-appserver/NGObjWeb/NGHttp/NGHttp.xcode/project.pbxproj b/sope-appserver/NGObjWeb/NGHttp/NGHttp.xcode/project.pbxproj index 76b4f2bb..bcd7986d 100644 --- a/sope-appserver/NGObjWeb/NGHttp/NGHttp.xcode/project.pbxproj +++ b/sope-appserver/NGObjWeb/NGHttp/NGHttp.xcode/project.pbxproj @@ -453,7 +453,7 @@ ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 4.5.145; + DYLIB_CURRENT_VERSION = 4.5.148; FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/sope-appserver/NGObjWeb/NGObjWeb.xcode/project.pbxproj b/sope-appserver/NGObjWeb/NGObjWeb.xcode/project.pbxproj index c5d7a3bc..6e28cdc8 100644 --- a/sope-appserver/NGObjWeb/NGObjWeb.xcode/project.pbxproj +++ b/sope-appserver/NGObjWeb/NGObjWeb.xcode/project.pbxproj @@ -1691,7 +1691,7 @@ ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 4.5.145; + DYLIB_CURRENT_VERSION = 4.5.148; FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1702,7 +1702,7 @@ HEADER_SEARCH_PATHS = ..; INFOPLIST_FILE = "NGObjWeb-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - OTHER_CFLAGS = "-DSOPE_MAJOR_VERSION=4 -DSOPE_MINOR_VERSION=5 -DSOPE_SUBMINOR_VERSION=145"; + OTHER_CFLAGS = "-DSOPE_MAJOR_VERSION=4 -DSOPE_MINOR_VERSION=5 -DSOPE_SUBMINOR_VERSION=148"; OTHER_LDFLAGS = "-seg1addr 0xC4900000 -headerpad_max_install_names"; OTHER_REZFLAGS = ""; PRODUCT_NAME = NGObjWeb; diff --git a/sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m b/sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m index 2dc5b324..4e5bccfe 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoObjectRequestHandler.m @@ -49,9 +49,10 @@ @implementation SoObjectRequestHandler -static BOOL debugOn = NO; -static BOOL debugRulesOn = NO; -static BOOL disableZLHack = NO; +static NGLogger *debugLogger = nil; +static NGLogger *logger = nil; +static BOOL debugRulesOn = NO; +static BOOL disableZLHack = NO; static Class WOTemplateClass = Nil; static NSString *rapidTurnAroundPath = nil; @@ -62,16 +63,22 @@ static NSString *redirectURISafetySuffix = nil; return [super version] + 0 /* 2 */; } + (void)initialize { - static BOOL didInit = NO; - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - if (didInit) - return; - + static BOOL didInit = NO; + NSUserDefaults *ud; + NGLoggerManager *lm; + + if (didInit) return; + didInit = YES; NSAssert2([super version] == 2, @"invalid superclass (%@) version %i !", NSStringFromClass([self superclass]), [super version]); - debugOn = [ud boolForKey:@"SoObjectRequestHandlerDebugEnabled"]; + + lm = [NGLoggerManager defaultLoggerManager]; + logger = [lm loggerForClass:self]; + debugLogger = [lm loggerForDefaultKey:@"SoObjectRequestHandlerDebugEnabled"]; + + ud = [NSUserDefaults standardUserDefaults]; debugRulesOn = [ud boolForKey:@"SoObjectRequestHandlerRulesDebugEnabled"]; disableZLHack = [ud boolForKey:@"DisableZideLookHack"]; @@ -493,7 +500,7 @@ static NSString *redirectURISafetySuffix = nil; id authenticator; BOOL doDispatch; - if (debugOn) { + if (debugLogger) { [self debugWithFormat:@"request 0x%08X: %@ %@ (ctx=0x%08X)", _rq, [_rq method], [_rq uri], _ctx]; if (_sn) [self debugWithFormat:@"session 0x%08X: %@", _sn, _sn]; @@ -502,16 +509,10 @@ static NSString *redirectURISafetySuffix = nil; /* first check safety marker */ if ([[_rq uri] hasSuffix:redirectURISafetySuffix]) { -#if 0 // does not work => znek's logging framework - [self logWithFormat: - @"ERROR: stopping processing because redirect safety suffix was " + [self errorWithFormat: + @"stopping processing because redirect safety suffix was " @"reached:\n uri=%@\n suffix=%@\n", [_rq uri], redirectURISafetySuffix]; -#else - NSLog(@"ERROR: stopping processing because redirect safety suffix was " - @"reached:\n uri=%@\n suffix=%@\n", - [_rq uri], redirectURISafetySuffix); -#endif r = [_ctx response]; [r setStatus:403 /* Forbidden */]; @@ -604,7 +605,7 @@ static NSString *redirectURISafetySuffix = nil; [r headerForKey:@"content-type"]]; } else { - if (debugOn) { + if (debugLogger) { if ([object isKindOfClass:[NSData class]]) { [self debugWithFormat:@"render data 0x%08X[len=%i]", object, [object length]]; @@ -616,7 +617,7 @@ static NSString *redirectURISafetySuffix = nil; [self->dispatcherRules takeValue:object forKey:@"result"]; r = [self renderObject:object inContext:_ctx]; - if (debugOn) { + if (debugLogger) { [self debugWithFormat: @"made response: 0x%08X (status=%i,len=%@,type=%@)", r, [r status], @@ -698,7 +699,13 @@ static NSString *redirectURISafetySuffix = nil; return @"[object-handler]"; } - (BOOL)isDebuggingEnabled { - return debugOn ? YES : NO; + return debugLogger ? YES : NO; +} +- (id)logger { + return logger; +} +- (id)debugLogger { + return debugLogger; } @end /* SoObjectRequestHandler(Logging) */ diff --git a/sope-appserver/NGObjWeb/SoObjects/SoObjects.xcode/project.pbxproj b/sope-appserver/NGObjWeb/SoObjects/SoObjects.xcode/project.pbxproj index 86dea56a..19cfc031 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoObjects.xcode/project.pbxproj +++ b/sope-appserver/NGObjWeb/SoObjects/SoObjects.xcode/project.pbxproj @@ -281,7 +281,7 @@ ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 4.5.145; + DYLIB_CURRENT_VERSION = 4.5.148; FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = NO; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 1c129d5d..5ffa3660 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=147 +SUBMINOR_VERSION:=148 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 diff --git a/sope-appserver/NGObjWeb/WebDAV/WebDAV.xcode/project.pbxproj b/sope-appserver/NGObjWeb/WebDAV/WebDAV.xcode/project.pbxproj index bad6eb15..4ca55c2f 100644 --- a/sope-appserver/NGObjWeb/WebDAV/WebDAV.xcode/project.pbxproj +++ b/sope-appserver/NGObjWeb/WebDAV/WebDAV.xcode/project.pbxproj @@ -226,7 +226,7 @@ ); buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 4.5.145; + DYLIB_CURRENT_VERSION = 4.5.148; FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks"; FRAMEWORK_VERSION = A; GCC_PRECOMPILE_PREFIX_HEADER = NO; -- 2.39.5