// // DistributedLogger.m // Pennyworth // // Created by Chris Karr on 12/24/07. // Copyright 2007 Chris J. Karr. All rights reserved. // #import "DistributedLogger.h" @implementation DistributedLogger - (void) awakeFromNib { // [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(log:) name:nil object:nil]; } - (void) log:(NSNotification *) notification { if ([[notification name] rangeOfString:@"itunes"].location == NSNotFound) return; NSLog (@"Log: %@ (%@)", [notification name], [notification object]); NSDictionary * dict = [notification userInfo]; for (NSString * key in [dict allKeys]) NSLog (@" %@ = %@", key, [dict valueForKey:key]); } @end