Created
October 21, 2015 05:18
-
-
Save KazuyukiEguchi/b9e2a2c0e8aaa560bbfa to your computer and use it in GitHub Desktop.
Swift 2.0 で CocoaPods の CocoaLumberjack を組み込んで使ってみる ref: http://qiita.com/KazuyukiEguchi/items/79cb93a1bc7dc0b5b9bc
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
$ pod install |
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
- (NSString *)defaultLogsDirectory { | |
#if TARGET_OS_IPHONE | |
// NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *baseDir = paths.firstObject; | |
NSString *logsDirectory = [baseDir stringByAppendingPathComponent:@"Logs"]; | |
#else | |
NSString *appName = [[NSProcessInfo processInfo] processName]; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); | |
NSString *basePath = ([paths count] > 0) ? paths[0] : NSTemporaryDirectory(); | |
NSString *logsDirectory = [[basePath stringByAppendingPathComponent:@"Logs"] stringByAppendingPathComponent:appName]; | |
#endif | |
return logsDirectory; | |
} |
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
pod 'CocoaLumberjack/Swift', | |
:git => ‘https://github.com/CocoaLumberjack/CocoaLumberjack.git', | |
:branch => 'swift_2.0' | |
use_frameworks! |
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
DDLogDebug("didUpdateToLocation") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment