Commit 7104c546 authored by darin's avatar darin
Browse files

Change all logging to use the new logging.

        * Misc.subproj/WebAssertions.h: Add real definition of WebLogChannel.
        * Misc.subproj/WebAssertions.m: (WebLog): Implement.

        * Misc.subproj/WebFoundationDebug.h: Removed.
        * Misc.subproj/WebFoundationDebug.m: Removed.
        * Misc.subproj/WebFoundationLogging.h: Added.
        * Misc.subproj/WebFoundationLogging.m: Added.
        * Misc.subproj/WebFoundationPrivate.h: Removed WebFoundationDebug.h.
        * WebFoundation.pbproj/project.pbxproj: Removed and added files.

        * AuthenticationManager.subproj/WebAuthenticationHandlerDispatcher.m:
        * CacheLoader.subproj/WebCFNetworkHTTPProtocolHandler.m:
        * CacheLoader.subproj/WebCacheObject.m:
        * CacheLoader.subproj/WebDiskCache.m:
        * CacheLoader.subproj/WebFileProtocolHandler.m:
        * CacheLoader.subproj/WebHTTPProtocolHandler.m:
        * CacheLoader.subproj/WebMemoryCache.m:
        * CacheLoader.subproj/WebProtocolHandler.m:
        * CacheLoader.subproj/WebResourceData.m:
        * CacheLoader.subproj/WebResourceHandle.m:
        * CacheLoader.subproj/WebResourceHandleInternal.m:
        * CacheLoader.subproj/WebResourceHandlePrivate.m:
        * CacheLoader.subproj/WebResourceLoad.m:
        * CacheLoader.subproj/WebResourceLoadManager.m:
        * CacheLoader.subproj/WebResourceLoadQueue.m:
        * CacheLoader.subproj/WebSimpleHTTPProtocolHandler.m:
        * CookieManager.subproj/WebCookie.m:
        * CookieManager.subproj/WebCookieAcceptHandlerDispatcher.m:
        * CookieManager.subproj/WebCookieManager.m:
        * CookieManager.subproj/WebCookieStorage.m:
        * Database.subproj/WebFileDatabase.m:
        * Misc.subproj/WebBinaryHeap.m:
        * Misc.subproj/WebHostNameResolver.m:
        * Misc.subproj/WebNSStringExtras.m:
        * Misc.subproj/WebQueue.m:
        * Misc.subproj/WebReadWriteLock.m:
        * Misc.subproj/WebRecursiveReadWriteLock.m:
        Update to use new log macro.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eda63608
......@@ -13,7 +13,8 @@
#import "WebFileDatabase.h"
#import "WebNSFileManagerExtras.h"
#import "WebCacheLoaderConstantsPrivate.h"
#import "WebFoundationDebug.h"
#import "WebAssertions.h"
#import "WebFoundationLogging.h"
#define SIZE_FILE_NAME @".size"
#define SIZE_FILE_NAME_CSTRING ".size"
......@@ -195,15 +196,15 @@ - (id)initWithPath:(NSString *)path
if (data) {
if (mappedBytes) {
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "mmaped disk cache file - %s", [path lossyCString]);
LOG(DiskCacheActivity, "mmaped disk cache file - %s", [path lossyCString]);
}
else {
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "fs read disk cache file - %s", [path lossyCString]);
LOG(DiskCacheActivity, "fs read disk cache file - %s", [path lossyCString]);
}
return self;
}
else {
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "no disk cache file - %s", [path lossyCString]);
LOG(DiskCacheActivity, "no disk cache file - %s", [path lossyCString]);
[self dealloc];
return nil;
}
......@@ -258,7 +259,7 @@ +(id)opWithCode:(WebFileDatabaseOpcode)theOpcode key:(id)theKey object:(id)theOb
-(id)initWithCode:(WebFileDatabaseOpcode)theOpcode key:(id)theKey object:(id)theObject
{
WEBFOUNDATION_ASSERT_NOT_NIL(theKey);
ASSERT(theKey);
if ((self = [super init])) {
......@@ -290,7 +291,7 @@ -(id)object
-(void)perform:(WebFileDatabase *)target
{
WEBFOUNDATION_ASSERT_NOT_NIL(target);
ASSERT(target);
switch (opcode) {
case WebFileDatabaseSetObjectOp:
......@@ -300,7 +301,7 @@ -(void)perform:(WebFileDatabase *)target
[target performRemoveObjectForKey:key];
break;
default:
WEBFOUNDATION_ASSERT_NOT_NIL(nil);
ASSERT(nil);
break;
}
}
......@@ -376,7 +377,7 @@ -(void)writeSizeFile:(unsigned)value
close(fd);
}
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "writing size file - %u", value);
LOG(DiskCacheActivity, "writing size file - %u", value);
[mutex unlock];
}
......@@ -434,7 +435,7 @@ -(void)truncateToSizeLimit:(unsigned)size
fileSize = [attributes objectForKey:NSFileSize];
if (fileSize) {
usage -= [fileSize unsignedIntValue];
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "truncateToSizeLimit - %u - %u - %u, %s", size, usage, [fileSize unsignedIntValue], DEBUG_OBJECT(spec->path));
LOG(DiskCacheActivity, "truncateToSizeLimit - %u - %u - %u, %@", size, usage, [fileSize unsignedIntValue], spec->path);
[defaultManager removeFileAtPath:spec->path handler:nil];
}
}
......@@ -515,8 +516,8 @@ -(void)setObject:(id)object forKey:(id)key
{
WebFileDatabaseOp *op;
WEBFOUNDATION_ASSERT_NOT_NIL(object);
WEBFOUNDATION_ASSERT_NOT_NIL(key);
ASSERT(object);
ASSERT(key);
touch = CFAbsoluteTimeGetCurrent();
......@@ -534,7 +535,7 @@ -(void)removeObjectForKey:(id)key
{
WebFileDatabaseOp *op;
WEBFOUNDATION_ASSERT_NOT_NIL(key);
ASSERT(key);
touch = CFAbsoluteTimeGetCurrent();
......@@ -563,7 +564,7 @@ -(void)removeAllObjects
usage = 0;
[mutex unlock];
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "removeAllObjects");
LOG(DiskCacheActivity, "removeAllObjects");
}
-(id)objectForKey:(id)key
......@@ -581,7 +582,7 @@ -(id)objectForKey:(id)key
data = nil;
unarchiver = nil;
WEBFOUNDATION_ASSERT_NOT_NIL(key);
ASSERT(key);
touch = CFAbsoluteTimeGetCurrent();
......@@ -615,7 +616,7 @@ -(id)objectForKey:(id)key
}
}
NS_HANDLER
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "cannot unarchive cache file - %s", DEBUG_OBJECT(key));
LOG(DiskCacheActivity, "cannot unarchive cache file - %@", key);
result = nil;
NS_ENDHANDLER
......@@ -644,11 +645,10 @@ -(void)performSetObject:(id)object forKey:(id)key
NSNumber *oldSize;
BOOL result;
WEBFOUNDATION_ASSERT_NOT_NIL(object);
WEBFOUNDATION_ASSERT_NOT_NIL(key);
ASSERT(object);
ASSERT(key);
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "performSetObject - %s - %s",
DEBUG_OBJECT(key), DEBUG_OBJECT([WebFileDatabase uniqueFilePathForKey:key]));
LOG(DiskCacheActivity, "performSetObject - %@ - %@", key, [WebFileDatabase uniqueFilePathForKey:key]);
data = [NSMutableData data];
archiver = [[NSArchiver alloc] initForWritingWithMutableData:data];
......@@ -706,9 +706,9 @@ -(void)performRemoveObjectForKey:(id)key
NSNumber *size;
BOOL result;
WEBFOUNDATION_ASSERT_NOT_NIL(key);
ASSERT(key);
WEBFOUNDATIONDEBUGLEVEL(WebFoundationLogDiskCacheActivity, "performRemoveObjectForKey - %s", DEBUG_OBJECT(key));
LOG(DiskCacheActivity, "performRemoveObjectForKey - %@", key);
filePath = [[NSString alloc] initWithFormat:@"%@/%@", path, [WebFileDatabase uniqueFilePathForKey:key]];
attributes = [[NSFileManager defaultManager] fileAttributesAtPath:filePath traverseLink:YES];
......@@ -782,7 +782,7 @@ -(void)lazySync:(NSTimer *)theTimer
{
WebFileDatabaseOp *op;
WEBFOUNDATION_ASSERT_NOT_NIL(theTimer);
ASSERT(theTimer);
while (touch + SYNC_IDLE_THRESHOLD < CFAbsoluteTimeGetCurrent() && [ops count] > 0) {
[mutex lock];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment