From: helge Date: Thu, 8 Feb 2007 21:28:45 +0000 (+0000) Subject: use errorWithFormat, fixed some logging crashers X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb35cb2cae0125f97ec34ee7c2863614c996f0c8;p=sope use errorWithFormat, fixed some logging crashers git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1413 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-gdl1/GDLContentStore/ChangeLog b/sope-gdl1/GDLContentStore/ChangeLog index afcd89ff..899ece9c 100644 --- a/sope-gdl1/GDLContentStore/ChangeLog +++ b/sope-gdl1/GDLContentStore/ChangeLog @@ -1,3 +1,8 @@ +2007-02-09 Helge Hess + + * use -errorWithFormat:, fixed a few logging crashes (incomplete format + strings) (v4.5.39) + 2007-02-08 Wolfgang Sourdeau * GCSFolder.m: added a gnustep-base hack to properly format bool diff --git a/sope-gdl1/GDLContentStore/EOQualifier+GCS.m b/sope-gdl1/GDLContentStore/EOQualifier+GCS.m index e7e62248..ec0103cc 100644 --- a/sope-gdl1/GDLContentStore/EOQualifier+GCS.m +++ b/sope-gdl1/GDLContentStore/EOQualifier+GCS.m @@ -90,7 +90,7 @@ [_ms appendString:@" ILIKE "]; } else { - [self logWithFormat:@"ERROR(%s): unsupported operation for null: %@", + [self errorWithFormat:@"%s: unsupported operation for null: %@", __PRETTY_FUNCTION__, NSStringFromSelector(op)]; } @@ -102,7 +102,7 @@ [_ms appendString:@"'"]; } else { - [self logWithFormat:@"ERROR(%s): unsupported value class: %@", + [self errorWithFormat:@"%s: unsupported value class: %@", __PRETTY_FUNCTION__, NSStringFromClass([val class])]; } } @@ -112,7 +112,7 @@ else if (sel_eq(op, EOQualifierOperatorEqual)) [_ms appendString:@" IS NOT NULL"]; else { - [self logWithFormat:@"ERROR(%s): invalid operation for null: %@", + [self errorWithFormat:@"%s: invalid operation for null: %@", __PRETTY_FUNCTION__, NSStringFromSelector(op)]; } } @@ -131,7 +131,7 @@ else if ([_q isKindOfClass:[EOKeyValueQualifier class]]) [self _appendKeyValueQualifier:(id)_q toString:_ms]; else - NSLog(@"ERROR: unknown qualifier: %@", _q); + [self errorWithFormat:@"unknown qualifier: %@", _q]; } - (void)_gcsAppendToString:(NSMutableString *)_ms { diff --git a/sope-gdl1/GDLContentStore/GCSChannelManager.m b/sope-gdl1/GDLContentStore/GCSChannelManager.m index 773387ca..7a86ec3d 100644 --- a/sope-gdl1/GDLContentStore/GCSChannelManager.m +++ b/sope-gdl1/GDLContentStore/GCSChannelManager.m @@ -173,14 +173,14 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60; adaptorName = [[self class] adaptorNameForURLScheme:[_url scheme]]; if ([adaptorName length] == 0) { - [self logWithFormat:@"ERROR: cannot handle URL: %@", _url]; + [self errorWithFormat:@"cannot handle URL: %@", _url]; return nil; } condict = [self connectionDictionaryForURL:_url]; if ((adaptor = [EOAdaptor adaptorWithName:adaptorName]) == nil) { - [self logWithFormat:@"ERROR: did not find adaptor '%@' for URL: %@", + [self errorWithFormat:@"did not find adaptor '%@' for URL: %@", adaptorName, _url]; return nil; } @@ -231,11 +231,11 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60; return nil; if ((adContext = [adaptor createAdaptorContext]) == nil) { - [self logWithFormat:@"ERROR: could not create adaptor context!"]; + [self errorWithFormat:@"could not create adaptor context!"]; return nil; } if ((adChannel = [adContext createAdaptorChannel]) == nil) { - [self logWithFormat:@"ERROR: could not create adaptor channel!"]; + [self errorWithFormat:@"could not create adaptor channel!"]; return nil; } return adChannel; @@ -275,7 +275,7 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60; if ([channel isOpen]) ; else if (![channel openChannel]) { - [self logWithFormat:@"could not open channel %@ for URL: %@", + [self errorWithFormat:@"could not open channel %@ for URL: %@", channel, [_url absoluteString]]; return nil; } diff --git a/sope-gdl1/GDLContentStore/GCSFolder.m b/sope-gdl1/GDLContentStore/GCSFolder.m index dbb54fde..5f8144c8 100644 --- a/sope-gdl1/GDLContentStore/GCSFolder.m +++ b/sope-gdl1/GDLContentStore/GCSFolder.m @@ -62,8 +62,7 @@ static GCSStringFormatter *stringFormatter = nil; folderManager:(GCSFolderManager *)_fm { if (![_loc isNotNull]) { - [self logWithFormat:@"ERROR(%s): missing quicktable parameter!", - __PRETTY_FUNCTION__]; + [self errorWithFormat:@"missing quicktable parameter!"]; [self release]; return nil; } @@ -247,8 +246,7 @@ static GCSStringFormatter *stringFormatter = nil; NSString *sql; if ((channel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!", - __PRETTY_FUNCTION__]; + [self errorWithFormat:@"could not open storage channel!"]; return nil; } @@ -265,7 +263,7 @@ static GCSStringFormatter *stringFormatter = nil; /* run SQL */ if ((error = [channel evaluateExpressionX:sql]) != nil) { - [self logWithFormat:@"ERROR(%s): cannot execute SQL '%@': %@", + [self errorWithFormat:@"%s: cannot execute SQL '%@': %@", __PRETTY_FUNCTION__, sql, error]; [self releaseChannel:channel]; return nil; @@ -308,7 +306,7 @@ static GCSStringFormatter *stringFormatter = nil; NSString *sql; if ((channel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!", + [self errorWithFormat:@"%s: could not open storage channel!", __PRETTY_FUNCTION__]; return nil; } @@ -338,11 +336,11 @@ static GCSStringFormatter *stringFormatter = nil; cContent = [row objectForKey:@"c_content"]; if (![cName isNotNull]) { - [self logWithFormat:@"ERROR: missing c_name in row: %@", row]; + [self errorWithFormat:@"missing c_name in row: %@", row]; continue; } if (![cContent isNotNull]) { - [self logWithFormat:@"ERROR: missing c_content in row: %@", row]; + [self errorWithFormat:@"missing c_content in row: %@", row]; continue; } @@ -557,12 +555,14 @@ static GCSStringFormatter *stringFormatter = nil; /* open channels */ if ((storeChannel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!"]; + [self errorWithFormat:@"%s: could not open storage channel!", + __PRETTY_FUNCTION__]; return nil; } if (!self->ofFlags.sameTableForQuick) { if ((quickChannel = [self acquireQuickChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open quick channel!"]; + [self errorWithFormat:@"%s: could not open quick channel!", + __PRETTY_FUNCTION__]; [self releaseChannel:storeChannel]; return nil; } @@ -623,8 +623,8 @@ static GCSStringFormatter *stringFormatter = nil; delsql = [delsql stringByAppendingString:@" WHERE c_name="]; delsql = [delsql stringByAppendingString:[self _formatRowValue:_name]]; if ((delErr = [storeChannel evaluateExpressionX:delsql]) != nil) { - [self logWithFormat: - @"ERROR(%s): could not delete content '%@' after quick-fail:" + [self errorWithFormat: + @"%s: could not delete content '%@' after quick-fail:" @" %@", __PRETTY_FUNCTION__, delsql, error]; } } @@ -660,12 +660,12 @@ static GCSStringFormatter *stringFormatter = nil; /* open channels */ if ((storeChannel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!"]; + [self errorWithFormat:@"could not open storage channel!"]; return nil; } if (!self->ofFlags.sameTableForQuick) { if ((quickChannel = [self acquireQuickChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open quick channel!"]; + [self errorWithFormat:@"could not open quick channel!"]; [self releaseChannel:storeChannel]; return nil; } @@ -677,8 +677,8 @@ static GCSStringFormatter *stringFormatter = nil; delsql = [delsql stringByAppendingString:@" WHERE c_name="]; delsql = [delsql stringByAppendingString:[self _formatRowValue:_name]]; if ((error = [storeChannel evaluateExpressionX:delsql]) != nil) { - [self logWithFormat: - @"ERROR(%s): cannot delete content '%@': %@", + [self errorWithFormat: + @"%s: cannot delete content '%@': %@", __PRETTY_FUNCTION__, delsql, error]; } else if (!self->ofFlags.sameTableForQuick) { @@ -687,8 +687,8 @@ static GCSStringFormatter *stringFormatter = nil; delsql = [delsql stringByAppendingString:@" WHERE c_name="]; delsql = [delsql stringByAppendingString:[self _formatRowValue:_name]]; if ((error = [quickChannel evaluateExpressionX:delsql]) != nil) { - [self logWithFormat: - @"ERROR(%s): cannot delete quick row '%@': %@", + [self errorWithFormat: + @"%s: cannot delete quick row '%@': %@", __PRETTY_FUNCTION__, delsql, error]; /* Note: we now have a "broken" record, needs to be periodically GCed by @@ -822,14 +822,14 @@ static GCSStringFormatter *stringFormatter = nil; /* open channel */ if ((channel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!"]; + [self errorWithFormat:@" could not open storage channel!"]; return nil; } /* run SQL */ if ((error = [channel evaluateExpressionX:sql]) != nil) { - [self logWithFormat:@"ERROR(%s): cannot execute quick-fetch SQL '%@': %@", + [self errorWithFormat:@"%s: cannot execute quick-fetch SQL '%@': %@", __PRETTY_FUNCTION__, sql, error]; [self releaseChannel:channel]; return nil; @@ -905,14 +905,14 @@ static GCSStringFormatter *stringFormatter = nil; /* open channel */ if ((channel = [self acquireAclChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open acl channel!"]; + [self errorWithFormat:@"could not open acl channel!"]; return nil; } /* run SQL */ if ((error = [channel evaluateExpressionX:sql]) != nil) { - [self logWithFormat:@"ERROR(%s): cannot execute acl-fetch SQL '%@': %@", + [self errorWithFormat:@"%s: cannot execute acl-fetch SQL '%@': %@", __PRETTY_FUNCTION__, sql, error]; [self releaseChannel:channel]; return nil;