-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRILog.m
52 lines (42 loc) · 911 Bytes
/
RILog.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// RILog.m
//
// Created by Jiva DeVoe on 11/22/12.
// Copyright (c) 2012 Random Ideas, LLC. All rights reserved.
//
#import "RILog.h"
@implementation RILog
+(id)sharedInstance
{
static dispatch_once_t once;
static id sharedInstance;
dispatch_once(&once, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
-(id)init
{
if((self = [super init]))
{
self.logLevel = RI_LOG_ERROR;
}
return self;
}
-(void)logMessageAtLevel:(RILogLevel)inLogLevel withFormat:(NSString *)format, ...;
{
if(inLogLevel <= self.logLevel)
{
va_list ap;
NSString *print;
va_start(ap,format);
print = [[NSString alloc] initWithFormat:format arguments:ap];
va_end(ap);
NSLog(@"%@", print);
}
}
-(BOOL)isLoggingEnabledOfType:(RILogLevel)type;
{
return (type <= self.logLevel);
}
@end