-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
110 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Logger.h | ||
// NTFS-OSX | ||
// | ||
// Created by Jeevanandam M. on 6/15/15. | ||
// Copyright (c) 2015 myjeeva.com. All rights reserved. | ||
// | ||
|
||
#define LogInfo(s, ...) NSLog(@"%@", [NSString stringWithFormat:(s), ##__VA_ARGS__]) | ||
#define LogDebug(s, ...) [Logger logFor:__FILE__ line:__LINE__ format:(s), ##__VA_ARGS__] | ||
|
||
@interface Logger : NSObject | ||
|
||
+ (void)setDebugLog:(BOOL)debugOn; | ||
+ (void)logFor:(char *)srcFile line:(int)line format:(NSString *)format, ...; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Logger.m | ||
// NTFS-OSX | ||
// | ||
// Created by Jeevanandam M. on 6/15/15. | ||
// Copyright (c) 2015 myjeeva.com. All rights reserved. | ||
// | ||
// Inspried by http://borkware.com/rants/agentm/mlog/ | ||
|
||
|
||
#import "Logger.h" | ||
|
||
static BOOL __DebugLogOn = NO; | ||
|
||
@implementation Logger | ||
|
||
+ (void)setDebugLog:(BOOL)debugOn { | ||
__DebugLogOn = debugOn; | ||
} | ||
|
||
+ (void)logFor:(char *)srcFile line:(int)line format:(NSString *)format, ... { | ||
if (__DebugLogOn == NO) { | ||
return; | ||
} | ||
|
||
va_list ap; | ||
NSString *file; | ||
NSString *msg; | ||
|
||
va_start(ap, format); | ||
file = [[NSString stringWithUTF8String:srcFile] lastPathComponent]; | ||
msg = [NSString stringWithFormat:format, ap]; | ||
va_end(ap); | ||
|
||
NSLog(@"[%@:%d] %@", file, line, msg); | ||
|
||
return; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ | |
@import Foundation; | ||
|
||
#import "Constants.h" | ||
#import "Logger.h" | ||
|
||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters