The GDASLLogManager manages GDASLLog objects. More...
#import <GDASLLogManager.h>
Public Member Functions | |
| (void) | - setLog:forKey: |
| Set a log object for key. | |
| (GDASLLog *) | - getLogForKey: |
| Get a log object by key. | |
Static Public Member Functions | |
| (GDASLLogManager *) | + sharedInstance |
| Singleton instance. | |
Protected Attributes | |
| NSMutableDictionary * | logs |
| Lookup for any stored log objects. | |
Properties | |
| Boolean | enabled |
| Whether or not logging is enabled. | |
The GDASLLogManager manages GDASLLog objects.
Here's an extracted example:
GDASLLogManager * logManager = [GDASLLogManager sharedInstance]; GDASLLog * log = [[GDASLLog alloc] initWithSender:@"MyAppName" facility:@"my.company.AppName" connectImmediately:TRUE]; [log setLogFile:@"/var/log/MyApp"]; [log info:@"TEST"]; [logManager setLog:log forKey:@"main"]; //pull out the log: GDASLLog * mainLog = [GDASLLogManager getLogForKey:@"main"]; [mainLog info:@"TEST2"];
Get a log object by key.
| key | The key the log was saved with. |
Set a log object for key.
| log | The GDASLLog to save. | |
| key | The key to store it with. |
- (Boolean) enabled [read, write, assign] |
Whether or not logging is enabled.
You can toggle this to disable or enable all GDASLLog instances - they're just disabled, not destroyed.