More NSLog usage cleanups

pull/69/merge
Ludovic Marcotte 2015-01-23 15:32:22 -05:00
parent e2bee23021
commit ab12c84887
7 changed files with 21 additions and 25 deletions

View File

@ -93,7 +93,7 @@
element = [elements objectAtIndex: 0];
else
{
NSLog(@"ERROR: given calendar contains no elements: %@", self);
//NSLog(@"ERROR: given calendar contains no elements: %@", self);
element = nil;
}

View File

@ -1,8 +1,6 @@
/* NSData+Mail.h - this file is part of SOGo
*
* Copyright (C) 2007 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,9 +1,6 @@
/* NSData+Mail.m - this file is part of SOGo
*
* Copyright (C) 2007-2008 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -52,7 +49,7 @@
else
{
decodedData = nil;
NSLog (@"encoding '%@' unknown, returning nil data", realEncoding);
//NSLog (@"encoding '%@' unknown, returning nil data", realEncoding);
}
}
else

View File

@ -11,6 +11,8 @@
#import <string.h>
#import <objc/objc.h>
#import <NGExtensions/NSObject+Logs.h>
static NSMutableDictionary *timezoneCache = nil;
#define BSONTYPE(tag,className) [className class], [NSNumber numberWithChar: (tag)]
@ -604,7 +606,7 @@ static NSDictionary *BSONTypes()
if (tz)
[timezoneCache setObject: tz forKey: key];
else
NSLog(@"ERROR: timezone (%@) not found when deserializing BSON data", key);
[self errorWithFormat: @"BSON error: timezone (%@) not found when deserializing BSON data", key];
}
return [NSCalendarDate dateWithYear: year

View File

@ -1,6 +1,6 @@
/* SOGoMailer.m - this file is part of SOGo
*
* Copyright (C) 2007-2014 Inverse inc.
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -213,7 +213,7 @@
}
NS_HANDLER
{
NSLog(@"Could not connect to the SMTP server %@ on port %d", host, port);
[self errorWithFormat: @"Could not connect to the SMTP server %@ on port %d", host, port];
result = [NSException exceptionWithHTTPStatus: 500
reason: @"cannot send message:"
@" (smtp) error when connecting"];

View File

@ -1,6 +1,6 @@
/* SOGoSieveManager.m - this file is part of SOGo
*
* Copyright (C) 2010-2014 Inverse inc.
* Copyright (C) 2010-2015 Inverse inc.
*
* Author: Inverse <info@inverse.ca>
*
@ -31,6 +31,7 @@
#import <SOGo/SOGoDomainDefaults.h>
#import <SOGo/SOGoUser.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGStreams/NGInternetSocketAddress.h>
#import <NGImap4/NGSieveClient.h>
@ -717,7 +718,7 @@ static NSString *sieveScriptName = @"sogo";
client = [[NGSieveClient alloc] initWithURL: url];
if (!client) {
NSLog(@"Sieve connection failed on %@", [url description]);
[self errorWithFormat: @"Sieve connection failed on %@", [url description]];
return nil;
}
@ -738,19 +739,19 @@ static NSString *sieveScriptName = @"sogo";
if (!connected)
{
NSLog(@"Sieve connection failed on %@", [url description]);
[self errorWithFormat: @"Sieve connection failed on %@", [url description]];
return nil;
}
if (![[result valueForKey:@"result"] boolValue] && !theUsername && !thePassword) {
NSLog(@"failure. Attempting with a renewed password (no authname supported)");
[self logWithFormat: @"failure. Attempting with a renewed password (no authname supported)"];
password = [theAccount imap4PasswordRenewed: YES];
result = [client login: login password: password];
}
if (![[result valueForKey:@"result"] boolValue]) {
NSLog(@"Could not login '%@' on Sieve server: %@: %@",
login, client, result);
[self logWithFormat: @"Could not login '%@' on Sieve server: %@: %@",
login, client, result];
[client closeConnection];
return nil;
}
@ -823,7 +824,7 @@ static NSString *sieveScriptName = @"sogo";
}
else
{
NSLog(@"Sieve generation failure: %@", [self lastScriptError]);
[self errorWithFormat: @"Sieve generation failure: %@", [self lastScriptError]];
[client closeConnection];
return NO;
}
@ -913,7 +914,7 @@ static NSString *sieveScriptName = @"sogo";
result = [client deleteScript: sieveScriptName];
if (![[result valueForKey:@"result"] boolValue]) {
NSLog(@"WARNING: Could not delete Sieve script - continuing...: %@", result);
[self logWithFormat: @"WARNING: Could not delete Sieve script - continuing...: %@", result];
}
// We put and activate the script only if we actually have a script
@ -923,14 +924,14 @@ static NSString *sieveScriptName = @"sogo";
result = [client putScript: sieveScriptName script: script];
if (![[result valueForKey:@"result"] boolValue]) {
NSLog(@"Could not upload Sieve script: %@", result);
[self logWithFormat: @"Could not upload Sieve script: %@", result];
[client closeConnection];
return NO;
}
result = [client setActiveScript: sieveScriptName];
if (![[result valueForKey:@"result"] boolValue]) {
NSLog(@"Could not enable Sieve script: %@", result);
[self logWithFormat: @"Could not enable Sieve script: %@", result];
[client closeConnection];
return NO;
}

View File

@ -1,8 +1,6 @@
/* SOGoWebDAVAclManager.m - this file is part of SOGo
*
* Copyright (C) 2008 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2008-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by