├── .gitignore ├── AppledocSettings.plist ├── Classes ├── MLSLogMacros.h ├── MLSLogger.h ├── MLSLogger.m ├── MLSLoggerLock.h └── MLSLoggerLock.m ├── LICENSE ├── MLSLogger.podspec ├── MLSLoggerDemo ├── MLSLoggerDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MLSLoggerDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MLSLoggerDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── CocoaLumberjack.xcodeproj │ └── project.pbxproj │ ├── CocoaLumberjack │ ├── Classes │ │ ├── CLI │ │ │ ├── CLIColor.h │ │ │ └── CLIColor.m │ │ ├── CocoaLumberjack.h │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogCapture.m │ │ ├── DDASLLogger.h │ │ ├── DDASLLogger.m │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAbstractDatabaseLogger.m │ │ ├── DDAssertMacros.h │ │ ├── DDFileLogger+Internal.h │ │ ├── DDFileLogger.h │ │ ├── DDFileLogger.m │ │ ├── DDLegacyMacros.h │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLog.m │ │ ├── DDLogMacros.h │ │ ├── DDLoggerNames.h │ │ ├── DDLoggerNames.m │ │ ├── DDOSLogger.h │ │ ├── DDOSLogger.m │ │ ├── DDTTYLogger.h │ │ ├── DDTTYLogger.m │ │ └── Extensions │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ ├── DDContextFilterLogFormatter.m │ │ │ ├── DDDispatchQueueLogFormatter.h │ │ │ ├── DDDispatchQueueLogFormatter.m │ │ │ ├── DDFileLogger+Buffering.h │ │ │ ├── DDFileLogger+Buffering.m │ │ │ ├── DDMultiFormatter.h │ │ │ └── DDMultiFormatter.m │ ├── LICENSE │ └── README.md │ ├── Local Podspecs │ └── MLSLogger.podspec.json │ ├── MLSLogger.xcodeproj │ └── project.pbxproj │ ├── Manifest.lock │ ├── Pods.xcodeproj │ └── project.pbxproj │ └── Target Support Files │ ├── CocoaLumberjack │ ├── CocoaLumberjack-Info.plist │ ├── CocoaLumberjack-dummy.m │ ├── CocoaLumberjack-prefix.pch │ ├── CocoaLumberjack-umbrella.h │ ├── CocoaLumberjack.modulemap │ └── CocoaLumberjack.xcconfig │ ├── MLSLogger │ ├── MLSLogger-Info.plist │ ├── MLSLogger-dummy.m │ ├── MLSLogger-prefix.pch │ ├── MLSLogger-umbrella.h │ ├── MLSLogger.modulemap │ └── MLSLogger.xcconfig │ └── Pods-MLSLoggerDemo │ ├── Pods-MLSLoggerDemo-Info.plist │ ├── Pods-MLSLoggerDemo-acknowledgements.markdown │ ├── Pods-MLSLoggerDemo-acknowledgements.plist │ ├── Pods-MLSLoggerDemo-dummy.m │ ├── Pods-MLSLoggerDemo-frameworks-Debug-input-files.xcfilelist │ ├── Pods-MLSLoggerDemo-frameworks-Debug-output-files.xcfilelist │ ├── Pods-MLSLoggerDemo-frameworks-Release-input-files.xcfilelist │ ├── Pods-MLSLoggerDemo-frameworks-Release-output-files.xcfilelist │ ├── Pods-MLSLoggerDemo-frameworks.sh │ ├── Pods-MLSLoggerDemo-umbrella.h │ ├── Pods-MLSLoggerDemo.debug.xcconfig │ ├── Pods-MLSLoggerDemo.modulemap │ └── Pods-MLSLoggerDemo.release.xcconfig ├── README.md ├── docs ├── html │ ├── Blocks │ │ └── MLSLogBlock.html │ ├── Classes │ │ └── MLSLogger.html │ ├── Constants │ │ ├── MLSLoggerEnv.html │ │ └── MLSLoggerShowLevel.html │ ├── css │ │ ├── scss │ │ │ ├── _index.scss │ │ │ ├── _layout.scss │ │ │ ├── _normalize.scss │ │ │ ├── _object.scss │ │ │ ├── _print.scss │ │ │ ├── _variables.scss │ │ │ ├── _xcode.scss │ │ │ └── style.scss │ │ └── style.css │ ├── hierarchy.html │ ├── img │ │ ├── button_bar_background.png │ │ ├── disclosure.png │ │ ├── disclosure_open.png │ │ ├── library_background.png │ │ └── title_background.png │ ├── index.html │ └── js │ │ └── script.js └── markdown │ ├── Blocks │ └── MLSLogBlock.md │ ├── Classes │ └── MLSLogger.md │ └── Constants │ ├── MLSLoggerEnv.md │ └── MLSLoggerShowLevel.md └── push_repo.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | MLSLoggerDemo/Pods 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /AppledocSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | --company-id 6 | cn.minlison 7 | --ignore 8 | 9 | ./Pods 10 | ./docs 11 | ./MLSLoggerDemo 12 | ./Classes/MLSLoggerLock.h 13 | *.m 14 | 15 | --logformat 16 | 1 17 | --print-settings 18 | 19 | --project-company 20 | MinLison 21 | --project-name 22 | MLSLogger 23 | --repeat-first-par 24 | 25 | --templates 26 | ./Templates 27 | --verbose 28 | 6 29 | --publish-docset 30 | 31 | --create-docset 32 | 33 | --install-docset 34 | 35 | --docset-install-path 36 | ./docs/docset 37 | --create-html 38 | 39 | --create-markdown 40 | 41 | --output 42 | ./docs 43 | --keep-undocumented-objects 44 | 45 | --keep-undocumented-members 46 | 47 | --search-undocumented-doc 48 | 49 | --keep-intermediate-files 50 | 51 | --preprocess-headerdoc 52 | 53 | --print-information-block-titles 54 | 55 | --merge-categories 56 | 57 | --merge-category-comment 58 | 59 | --use-code-order 60 | 61 | --clean-output 62 | 63 | --warn-undocumented-object 64 | 65 | --warn-undocumented-member 66 | 67 | --warn-missing-arg 68 | 69 | --warn-invalid-crossref 70 | 71 | --warn-unknown-directive 72 | 73 | --warn-empty-description 74 | 75 | --warn-unsupported-typedef-enum 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Classes/MLSLogMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLogMacros.h 3 | // MLSLogger 4 | // 5 | // Created by MinLison on 2018/5/17. 6 | // 7 | 8 | #import 9 | #ifndef LB_LOG_LEVEL_DEF 10 | #define LB_LOG_LEVEL_DEF lbloglevel 11 | #endif 12 | 13 | #define NSLogErrorInner(frmt, ...) LOG_MAYBE(NO, LB_LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 14 | #define NSLogWarnInner(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 15 | #define NSLogInfoInner(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 16 | #define NSLogDebugInner(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 17 | #define NSLogVerboseInner(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 18 | 19 | #define NSLogErrorToDDLogInner(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, NO, LB_LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 20 | #define NSLogWarnToLBLogInner(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 21 | #define NSLogInfoToLBLogInner(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 22 | #define NSLogDebugToLBLogInner(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 23 | #define NSLogVerboseToLBLogInner(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LB_LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 24 | -------------------------------------------------------------------------------- /Classes/MLSLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // MLSLogger.h 3 | // MLSLogger 4 | // 5 | // Created by MinLison on 2018/5/7. 6 | // Copyright © 2018年 MinLison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define NSLogVerbose(fmt, ...) MLSLogger.verbose((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 12 | #define NSLogInfo(fmt, ...) MLSLogger.info((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 13 | #define NSLogDebug(fmt, ...) MLSLogger.debug((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 14 | #define NSLogError(fmt, ...) MLSLogger.error((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 15 | #define NSLogWarn(fmt, ...) MLSLogger.warning((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 16 | 17 | /** 18 | 日志显示级别 19 | 20 | - MLSLoggerShowLevelVerbose: 全部 默认 21 | - MLSLoggerShowLevelInfo: 信息 22 | - MLSLoggerShowLevelDebug: 调试 23 | - MLSLoggerShowLevelWarning: 警告 24 | - MLSLoggerShowLevelError: 错误 25 | */ 26 | typedef NS_ENUM(NSInteger, MLSLoggerShowLevel) 27 | { 28 | MLSLoggerShowLevelAll, 29 | MLSLoggerShowLevelVerbose, 30 | MLSLoggerShowLevelDebug, 31 | MLSLoggerShowLevelInfo, 32 | MLSLoggerShowLevelWarning, 33 | MLSLoggerShowLevelError, 34 | MLSLoggerShowLevelOff, 35 | }; 36 | 37 | /** 38 | 日志模式 39 | 40 | - MLSLoggerEnvDebug: 调试模式, 对应日志级别 MLSLoggerShowLevelVerbose 41 | - MLSLoggerEnvTest: 测试模式 对应日志级别 MLSLoggerShowLevelInfo 42 | - MLSLoggerEnvPreRelease: 预发布模式 对应日志级别 MLSLoggerShowLevelWarning 43 | - MLSLoggerEnvGrayScaleRelease: 灰度发布 对应日志级别 MLSLoggerShowLevelError 44 | - MLSLoggerEnvRelease: 发布 对应日志级别 MLSLoggerShowLevelError 45 | */ 46 | typedef NS_ENUM(NSInteger, MLSLoggerEnv) 47 | { 48 | MLSLoggerEnvDebug, 49 | MLSLoggerEnvTest, 50 | MLSLoggerEnvPreRelease, 51 | MLSLoggerEnvGrayScaleRelease, 52 | MLSLoggerEnvRelease, 53 | }; 54 | 55 | 56 | @class MLSLogger; 57 | /** 58 | 日志函数输出函数 59 | */ 60 | typedef void (^MLSLogBlock)(NSString *format, ...); 61 | 62 | 63 | /** 64 | showLevel 与 env 冲突, 以最后一个设置为准 65 | */ 66 | @interface MLSLogger : NSObject 67 | 68 | 69 | /** 70 | 日志显示级别 Default MLSLoggerShowLevelOff 71 | */ 72 | @property (nonatomic, assign, class) MLSLoggerShowLevel showLevel; 73 | 74 | /** 75 | 日志模式 Default MLSLoggerEnvDebug 76 | 非发布模式,日志记录在 Document 下,可以 copy 出来 77 | 发布模式下,日志记录在 Library 下,不可以 copy 出来 78 | */ 79 | @property (nonatomic, assign, class) MLSLoggerEnv env; 80 | 81 | /** 82 | verbose 日志级别 83 | */ 84 | @property (copy, nonatomic, class, readonly) MLSLogBlock verbose; 85 | 86 | /** 87 | info 日志级别 88 | */ 89 | @property (copy, nonatomic, class, readonly) MLSLogBlock info; 90 | 91 | /** 92 | debug 日志级别 93 | */ 94 | @property (copy, nonatomic, class, readonly) MLSLogBlock debug; 95 | 96 | /** 97 | warning 日志级别 98 | */ 99 | @property (copy, nonatomic, class, readonly) MLSLogBlock warning; 100 | 101 | /** 102 | error 日志级别 103 | */ 104 | @property (copy, nonatomic, class, readonly) MLSLogBlock error; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Classes/MLSLogger.m: -------------------------------------------------------------------------------- 1 | // 2 | // MLSLogger.m 3 | // MLSLogger 4 | // 5 | // Created by MinLison on 2018/5/7. 6 | // Copyright © 2018年 MinLison. All rights reserved. 7 | // 8 | 9 | #import "MLSLogger.h" 10 | #import "MLSLogMacros.h" 11 | #import "MLSLoggerLock.h" 12 | 13 | static DDLogLevel lbloglevel = DDLogLevelAll; 14 | static MLSLoggerShowLevel _showLevel = MLSLoggerShowLevelVerbose; 15 | static MLSLoggerEnv _env = MLSLoggerEnvDebug; 16 | 17 | @implementation MLSLogger 18 | + (MLSLoggerShowLevel)showLevel { 19 | return _showLevel; 20 | } 21 | 22 | + (void)setShowLevel:(MLSLoggerShowLevel)showLevel { 23 | if ([MLSLoggerLock tryLock] ) { 24 | _showLevel = showLevel; 25 | switch (showLevel) { 26 | case MLSLoggerShowLevelAll: 27 | lbloglevel = DDLogLevelAll; 28 | break; 29 | case MLSLoggerShowLevelVerbose: 30 | lbloglevel = DDLogLevelVerbose; 31 | break; 32 | case MLSLoggerShowLevelInfo: 33 | lbloglevel = DDLogLevelInfo; 34 | break; 35 | case MLSLoggerShowLevelDebug: 36 | lbloglevel = DDLogLevelDebug; 37 | break; 38 | case MLSLoggerShowLevelWarning: 39 | lbloglevel = DDLogLevelWarning; 40 | break; 41 | case MLSLoggerShowLevelError: 42 | lbloglevel = DDLogLevelError; 43 | break; 44 | case MLSLoggerShowLevelOff: 45 | lbloglevel = DDLogLevelOff; 46 | break; 47 | } 48 | [MLSLoggerLock unLock]; 49 | } 50 | [self configLogger]; 51 | 52 | } 53 | 54 | + (MLSLoggerEnv)env { 55 | return _env; 56 | } 57 | 58 | + (void)setEnv:(MLSLoggerEnv)env { 59 | if ([MLSLoggerLock tryLock]) { 60 | _env = env; 61 | switch (env) { 62 | case MLSLoggerEnvDebug: 63 | [self setShowLevel:(MLSLoggerShowLevelVerbose)]; 64 | break; 65 | case MLSLoggerEnvTest: 66 | [self setShowLevel:(MLSLoggerShowLevelInfo)]; 67 | break; 68 | case MLSLoggerEnvPreRelease: 69 | [self setShowLevel:(MLSLoggerShowLevelInfo)]; 70 | break; 71 | case MLSLoggerEnvGrayScaleRelease: 72 | [self setShowLevel:(MLSLoggerShowLevelWarning)]; 73 | break; 74 | case MLSLoggerEnvRelease: 75 | [self setShowLevel:(MLSLoggerShowLevelError)]; 76 | break; 77 | } 78 | [MLSLoggerLock unLock]; 79 | } 80 | [self configLogger]; 81 | 82 | } 83 | + (void)configLogger { 84 | if ([MLSLoggerLock tryLock]) { 85 | 86 | NSString *logDir = @""; 87 | if (_env != MLSLoggerEnvRelease) { 88 | logDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject stringByAppendingPathComponent:@"mlslogger.log"]; 89 | } else { 90 | logDir = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).lastObject stringByAppendingPathComponent:@"mlslogger.log"]; 91 | } 92 | BOOL isDir = NO; 93 | if ([[NSFileManager defaultManager] fileExistsAtPath:logDir isDirectory:&isDir]) { 94 | if (!isDir) { 95 | [[NSFileManager defaultManager] createDirectoryAtPath:logDir withIntermediateDirectories:YES attributes:nil error:NULL]; 96 | } 97 | } else { 98 | [[NSFileManager defaultManager] createDirectoryAtPath:logDir withIntermediateDirectories:YES attributes:nil error:NULL]; 99 | } 100 | DDLogFileManagerDefault *fileManager = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:logDir]; 101 | DDFileLogger *fileLogger = [[DDFileLogger alloc] initWithLogFileManager:fileManager]; 102 | 103 | fileLogger.maximumFileSize = 10 * 1024 * 1024; // 10MB 104 | 105 | [DDLog addLogger:fileLogger withLevel:(DDLogLevelAll)]; 106 | [DDLog addLogger:[DDTTYLogger sharedInstance] withLevel:(DDLogLevelAll)]; 107 | [MLSLoggerLock unLock]; 108 | } 109 | } 110 | 111 | + (MLSLogBlock)verbose { 112 | return ^(NSString *format, ...) { 113 | 114 | if ([MLSLoggerLock tryLock]) { 115 | NSString *message = @""; 116 | if (format) { 117 | va_list args; 118 | va_start(args, format); 119 | 120 | message = [[NSString alloc] initWithFormat:format arguments:args]; 121 | 122 | va_end(args); 123 | } 124 | if (![NSThread currentThread].isMainThread) { 125 | dispatch_sync(dispatch_get_main_queue(), ^{ 126 | NSLogVerboseInner(@"🗯🗯🗯%@🗯🗯🗯",message); 127 | }); 128 | } else { 129 | NSLogVerboseInner(@"🗯🗯🗯%@🗯🗯🗯",message); 130 | } 131 | [MLSLoggerLock unLock]; 132 | } 133 | }; 134 | } 135 | 136 | + (MLSLogBlock)info { 137 | return ^(NSString *format, ...) { 138 | if ([MLSLoggerLock tryLock]) { 139 | NSString *message = @""; 140 | if (format) { 141 | va_list args; 142 | va_start(args, format); 143 | 144 | message = [[NSString alloc] initWithFormat:format arguments:args]; 145 | 146 | 147 | va_end(args); 148 | } 149 | if (![NSThread currentThread].isMainThread) { 150 | dispatch_sync(dispatch_get_main_queue(), ^{ 151 | NSLogInfoInner(@"ℹ️ℹ️ℹ️%@ℹ️ℹ️ℹ️",message); 152 | }); 153 | } else { 154 | NSLogInfoInner(@"ℹ️ℹ️ℹ️%@ℹ️ℹ️ℹ️",message); 155 | } 156 | [MLSLoggerLock unLock]; 157 | } 158 | }; 159 | } 160 | 161 | + (MLSLogBlock)error { 162 | return ^(NSString *format, ...) { 163 | if ([MLSLoggerLock tryLock]) { 164 | 165 | NSString *message = @""; 166 | 167 | if (format) { 168 | va_list args; 169 | va_start(args, format); 170 | 171 | message = [[NSString alloc] initWithFormat:format arguments:args]; 172 | 173 | va_end(args); 174 | } 175 | if (![NSThread currentThread].isMainThread) { 176 | dispatch_sync(dispatch_get_main_queue(), ^{ 177 | NSLogErrorInner(@"‼️‼️‼️%@‼️‼️‼️",message); 178 | }); 179 | } else { 180 | NSLogErrorInner(@"‼️‼️‼️%@‼️‼️‼️",message); 181 | } 182 | [MLSLoggerLock unLock]; 183 | } 184 | }; 185 | } 186 | 187 | + (MLSLogBlock)warning { 188 | return ^(NSString *format, ...) { 189 | if ([MLSLoggerLock tryLock]) { 190 | NSString *message = @""; 191 | if (format) { 192 | va_list args; 193 | va_start(args, format); 194 | 195 | message = [[NSString alloc] initWithFormat:format arguments:args]; 196 | 197 | va_end(args); 198 | } 199 | if (![NSThread currentThread].isMainThread) { 200 | dispatch_sync(dispatch_get_main_queue(), ^{ 201 | NSLogWarnInner(@"⚠️⚠️⚠️%@⚠️⚠️⚠️",message); 202 | }); 203 | } else { 204 | NSLogWarnInner(@"⚠️⚠️⚠️%@⚠️⚠️⚠️",message); 205 | } 206 | [MLSLoggerLock unLock]; 207 | } 208 | }; 209 | } 210 | 211 | + (MLSLogBlock)debug { 212 | return ^(NSString *format, ...) { 213 | if ([MLSLoggerLock tryLock]) { 214 | NSString *message = @""; 215 | if (format) { 216 | va_list args; 217 | va_start(args, format); 218 | 219 | message = [[NSString alloc] initWithFormat:format arguments:args]; 220 | 221 | va_end(args); 222 | } 223 | if (![NSThread currentThread].isMainThread) { 224 | dispatch_sync(dispatch_get_main_queue(), ^{ 225 | NSLogDebugInner(@"🔹🔹🔹%@🔹🔹🔹",message); 226 | }); 227 | } else { 228 | NSLogDebugInner(@"🔹🔹🔹%@🔹🔹🔹",message); 229 | } 230 | [MLSLoggerLock unLock]; 231 | } 232 | }; 233 | } 234 | @end 235 | -------------------------------------------------------------------------------- /Classes/MLSLoggerLock.h: -------------------------------------------------------------------------------- 1 | // 2 | // MLSLoggerLock.h 3 | // CocoaLumberjack 4 | // 5 | // Created by MinLison on 2018/5/7. 6 | // 7 | 8 | #import 9 | 10 | @interface MLSLoggerLock : NSObject 11 | + (BOOL)tryLock; 12 | + (void)unLock; 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/MLSLoggerLock.m: -------------------------------------------------------------------------------- 1 | // 2 | // MLSLoggerLock.m 3 | // CocoaLumberjack 4 | // 5 | // Created by MinLison on 2018/5/7. 6 | // 7 | 8 | #import "MLSLoggerLock.h" 9 | @interface MLSLoggerLock () 10 | @property (nonatomic, strong) NSRecursiveLock *lock; 11 | @end 12 | @implementation MLSLoggerLock 13 | + (instancetype)sharedInstance { 14 | static dispatch_once_t onceToken; 15 | static MLSLoggerLock *instance = nil; 16 | dispatch_once(&onceToken,^{ 17 | instance = [[super allocWithZone:NULL] init]; 18 | instance.lock = [[NSRecursiveLock alloc] init]; 19 | }); 20 | return instance; 21 | } 22 | 23 | + (id)allocWithZone:(struct _NSZone *)zone { 24 | return [self sharedInstance]; 25 | } 26 | + (BOOL)tryLock { 27 | return [[MLSLoggerLock sharedInstance].lock tryLock]; 28 | } 29 | + (void)unLock { 30 | [[MLSLoggerLock sharedInstance].lock unlock]; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Minlison 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MLSLogger.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "MLSLogger" 4 | s.version = "1.0.0" 5 | s.summary = "模块化日志管理工具" 6 | s.description = <<-DESC 7 | 模块化日志管理工具, 统一配置处理日志,减少项目内垃圾代码 8 | DESC 9 | 10 | s.homepage = "https://www.minlison.cn" 11 | s.license = "MIT" 12 | s.author = { "Minlison" => "yuanhang.1991@163.com" } 13 | s.platform = :ios, "8.0" 14 | s.static_framework = true 15 | s.source = { :git => "https://github.com/Minlison/MLSLogger.git", :tag => "v#{s.version}" } 16 | s.documentation_url = "https://www.minlison.cn/article/mlslogger" 17 | s.source_files = "Classes/**/*.{h,m}" 18 | s.public_header_files = "Classes/**/MLSLogger.h" 19 | s.requires_arc = true 20 | s.dependency "CocoaLumberjack", '>= 3.5.2' 21 | end 22 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MLSLoggerDemo 4 | // 5 | // Created by yuanhang on 2019/8/21. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MLSLoggerDemo 4 | // 5 | // Created by yuanhang on 2019/8/21. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MLSLoggerDemo 4 | // 5 | // Created by yuanhang on 2019/8/21. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // MLSLoggerDemo 4 | // 5 | // Created by yuanhang on 2019/8/21. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MLSLoggerDemo/MLSLoggerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MLSLoggerDemo 4 | // 5 | // Created by yuanhang on 2019/8/21. 6 | // Copyright © 2019 minlison. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://cdn.cocoapods.org/' 2 | 3 | platform :ios, '9.0' 4 | install! 'cocoapods', 5 | deterministic_uuids: false, 6 | disable_input_output_paths: true, 7 | generate_multiple_pod_projects: true 8 | incremental_installation: true 9 | 10 | target 'MLSLoggerDemo' do 11 | # Comment the next line if you don't want to use dynamic frameworks 12 | use_frameworks! 13 | 14 | pod 'MLSLogger', :path => '../' 15 | 16 | end 17 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (3.5.3): 3 | - CocoaLumberjack/Core (= 3.5.3) 4 | - CocoaLumberjack/Core (3.5.3) 5 | - MLSLogger (1.0.0): 6 | - CocoaLumberjack (>= 3.5.2) 7 | 8 | DEPENDENCIES: 9 | - MLSLogger (from `../`) 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - CocoaLumberjack 14 | 15 | EXTERNAL SOURCES: 16 | MLSLogger: 17 | :path: "../" 18 | 19 | SPEC CHECKSUMS: 20 | CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947 21 | MLSLogger: c01a6100e48e88f907242a13652be022f6c26703 22 | 23 | PODFILE CHECKSUM: 0204bbb5ec6ae6ff311c424874d5e9f2c7d19d57 24 | 25 | COCOAPODS: 1.7.3 26 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/CLI/CLIColor.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #if TARGET_OS_OSX 17 | 18 | #import 19 | #import 20 | 21 | /** 22 | * This class represents an NSColor replacement for CLI projects that don't link with AppKit 23 | **/ 24 | @interface CLIColor : NSObject 25 | 26 | /** 27 | * Convenience method for creating a `CLIColor` instance from RGBA params 28 | * 29 | * @param red red channel, between 0 and 1 30 | * @param green green channel, between 0 and 1 31 | * @param blue blue channel, between 0 and 1 32 | * @param alpha alpha channel, between 0 and 1 33 | */ 34 | + (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 35 | 36 | /** 37 | * Get the RGBA components from a `CLIColor` 38 | * 39 | * @param red red channel, between 0 and 1 40 | * @param green green channel, between 0 and 1 41 | * @param blue blue channel, between 0 and 1 42 | * @param alpha alpha channel, between 0 and 1 43 | */ 44 | - (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha NS_SWIFT_NAME(get(red:green:blue:alpha:)); 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/CLI/CLIColor.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #if TARGET_OS_OSX 17 | 18 | #import "CLIColor.h" 19 | 20 | @interface CLIColor () { 21 | CGFloat _red, _green, _blue, _alpha; 22 | } 23 | 24 | @end 25 | 26 | 27 | @implementation CLIColor 28 | 29 | + (CLIColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { 30 | CLIColor *color = [CLIColor new]; 31 | 32 | color->_red = red; 33 | color->_green = green; 34 | color->_blue = blue; 35 | color->_alpha = alpha; 36 | return color; 37 | } 38 | 39 | - (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha { 40 | if (red) { 41 | *red = _red; 42 | } 43 | 44 | if (green) { 45 | *green = _green; 46 | } 47 | 48 | if (blue) { 49 | *blue = _blue; 50 | } 51 | 52 | if (alpha) { 53 | *alpha = _alpha; 54 | } 55 | } 56 | 57 | @end 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Welcome to CocoaLumberjack! 18 | * 19 | * The project page has a wealth of documentation if you have any questions. 20 | * https://github.com/CocoaLumberjack/CocoaLumberjack 21 | * 22 | * If you're new to the project you may wish to read "Getting Started" at: 23 | * Documentation/GettingStarted.md 24 | * 25 | * Otherwise, here is a quick refresher. 26 | * There are three steps to using the macros: 27 | * 28 | * Step 1: 29 | * Import the header in your implementation or prefix file: 30 | * 31 | * #import 32 | * 33 | * Step 2: 34 | * Define your logging level in your implementation file: 35 | * 36 | * // Log levels: off, error, warn, info, verbose 37 | * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; 38 | * 39 | * Step 2 [3rd party frameworks]: 40 | * 41 | * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: 42 | * 43 | * // #undef LOG_LEVEL_DEF // Undefine first only if needed 44 | * #define LOG_LEVEL_DEF myLibLogLevel 45 | * 46 | * Define your logging level in your implementation file: 47 | * 48 | * // Log levels: off, error, warn, info, verbose 49 | * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; 50 | * 51 | * Step 3: 52 | * Replace your NSLog statements with DDLog statements according to the severity of the message. 53 | * 54 | * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); 55 | * 56 | * DDLog works exactly the same as NSLog. 57 | * This means you can pass it multiple variables just like NSLog. 58 | **/ 59 | 60 | #import 61 | 62 | //! Project version number for CocoaLumberjack. 63 | FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; 64 | 65 | //! Project version string for CocoaLumberjack. 66 | FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; 67 | 68 | // Disable legacy macros 69 | #ifndef DD_LEGACY_MACROS 70 | #define DD_LEGACY_MACROS 0 71 | #endif 72 | 73 | // Core 74 | #import 75 | 76 | // Main macros 77 | #import 78 | #import 79 | 80 | // Capture ASL 81 | #import 82 | 83 | // Loggers 84 | #import 85 | 86 | #import 87 | #import 88 | #import 89 | #import 90 | 91 | // Extensions 92 | #import 93 | #import 94 | #import 95 | #import 96 | 97 | // CLI 98 | #import 99 | 100 | // etc 101 | #import 102 | #import 103 | #import 104 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | @protocol DDLogger; 19 | 20 | /** 21 | * This class provides the ability to capture the ASL (Apple System Logs) 22 | */ 23 | API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) 24 | @interface DDASLLogCapture : NSObject 25 | 26 | /** 27 | * Start capturing logs 28 | */ 29 | + (void)start; 30 | 31 | /** 32 | * Stop capturing logs 33 | */ 34 | + (void)stop; 35 | 36 | /** 37 | * The current capture level. 38 | * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). 39 | */ 40 | @property (class) DDLogLevel captureLevel; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDASLLogCapture.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogCapture.h" 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #if !TARGET_OS_WATCH 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | static BOOL _cancel = YES; 31 | static DDLogLevel _captureLevel = DDLogLevelVerbose; 32 | 33 | @implementation DDASLLogCapture 34 | 35 | + (void)start { 36 | // Ignore subsequent calls 37 | if (!_cancel) { 38 | return; 39 | } 40 | 41 | _cancel = NO; 42 | 43 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { 44 | [self captureAslLogs]; 45 | }); 46 | } 47 | 48 | + (void)stop { 49 | _cancel = YES; 50 | } 51 | 52 | + (DDLogLevel)captureLevel { 53 | return _captureLevel; 54 | } 55 | 56 | + (void)setCaptureLevel:(DDLogLevel)level { 57 | _captureLevel = level; 58 | } 59 | 60 | #pragma mark - Private methods 61 | 62 | + (void)configureAslQuery:(aslmsg)query { 63 | const char param[] = "7"; // ASL_LEVEL_DEBUG, which is everything. We'll rely on regular DDlog log level to filter 64 | 65 | asl_set_query(query, ASL_KEY_LEVEL, param, ASL_QUERY_OP_LESS_EQUAL | ASL_QUERY_OP_NUMERIC); 66 | 67 | // Don't retrieve logs from our own DDASLLogger 68 | asl_set_query(query, kDDASLKeyDDLog, kDDASLDDLogValue, ASL_QUERY_OP_NOT_EQUAL); 69 | 70 | #if !TARGET_OS_IPHONE || (defined(TARGET_SIMULATOR) && TARGET_SIMULATOR) 71 | int processId = [[NSProcessInfo processInfo] processIdentifier]; 72 | char pid[16]; 73 | snprintf(pid, sizeof(pid), "%d", processId); 74 | asl_set_query(query, ASL_KEY_PID, pid, ASL_QUERY_OP_EQUAL | ASL_QUERY_OP_NUMERIC); 75 | #endif 76 | } 77 | 78 | + (void)aslMessageReceived:(aslmsg)msg { 79 | const char* messageCString = asl_get( msg, ASL_KEY_MSG ); 80 | if ( messageCString == NULL ) 81 | return; 82 | 83 | DDLogFlag flag; 84 | BOOL async; 85 | 86 | const char* levelCString = asl_get(msg, ASL_KEY_LEVEL); 87 | switch (levelCString? atoi(levelCString) : 0) { 88 | // By default all NSLog's with a ASL_LEVEL_WARNING level 89 | case ASL_LEVEL_EMERG : 90 | case ASL_LEVEL_ALERT : 91 | case ASL_LEVEL_CRIT : flag = DDLogFlagError; async = NO; break; 92 | case ASL_LEVEL_ERR : flag = DDLogFlagWarning; async = YES; break; 93 | case ASL_LEVEL_WARNING : flag = DDLogFlagInfo; async = YES; break; 94 | case ASL_LEVEL_NOTICE : flag = DDLogFlagDebug; async = YES; break; 95 | case ASL_LEVEL_INFO : 96 | case ASL_LEVEL_DEBUG : 97 | default : flag = DDLogFlagVerbose; async = YES; break; 98 | } 99 | 100 | if (!(_captureLevel & flag)) { 101 | return; 102 | } 103 | 104 | // NSString * sender = [NSString stringWithCString:asl_get(msg, ASL_KEY_SENDER) encoding:NSUTF8StringEncoding]; 105 | NSString *message = @(messageCString); 106 | 107 | const char* secondsCString = asl_get( msg, ASL_KEY_TIME ); 108 | const char* nanoCString = asl_get( msg, ASL_KEY_TIME_NSEC ); 109 | NSTimeInterval seconds = secondsCString ? strtod(secondsCString, NULL) : [NSDate timeIntervalSinceReferenceDate] - NSTimeIntervalSince1970; 110 | double nanoSeconds = nanoCString? strtod(nanoCString, NULL) : 0; 111 | NSTimeInterval totalSeconds = seconds + (nanoSeconds / 1e9); 112 | 113 | NSDate *timeStamp = [NSDate dateWithTimeIntervalSince1970:totalSeconds]; 114 | 115 | DDLogMessage *logMessage = [[DDLogMessage alloc]initWithMessage:message 116 | level:_captureLevel 117 | flag:flag 118 | context:0 119 | file:@"DDASLLogCapture" 120 | function:nil 121 | line:0 122 | tag:nil 123 | options:0 124 | timestamp:timeStamp]; 125 | 126 | [DDLog log:async message:logMessage]; 127 | } 128 | 129 | + (void)captureAslLogs { 130 | @autoreleasepool 131 | { 132 | /* 133 | We use ASL_KEY_MSG_ID to see each message once, but there's no 134 | obvious way to get the "next" ID. To bootstrap the process, we'll 135 | search by timestamp until we've seen a message. 136 | */ 137 | 138 | struct timeval timeval = { 139 | .tv_sec = 0 140 | }; 141 | gettimeofday(&timeval, NULL); 142 | unsigned long long startTime = (unsigned long long)timeval.tv_sec; 143 | __block unsigned long long lastSeenID = 0; 144 | 145 | /* 146 | syslogd posts kNotifyASLDBUpdate (com.apple.system.logger.message) 147 | through the notify API when it saves messages to the ASL database. 148 | There is some coalescing - currently it is sent at most twice per 149 | second - but there is no documented guarantee about this. In any 150 | case, there may be multiple messages per notification. 151 | 152 | Notify notifications don't carry any payload, so we need to search 153 | for the messages. 154 | */ 155 | int notifyToken = 0; // Can be used to unregister with notify_cancel(). 156 | notify_register_dispatch(kNotifyASLDBUpdate, ¬ifyToken, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(int token) 157 | { 158 | // At least one message has been posted; build a search query. 159 | @autoreleasepool 160 | { 161 | aslmsg query = asl_new(ASL_TYPE_QUERY); 162 | char stringValue[64]; 163 | 164 | if (lastSeenID > 0) { 165 | snprintf(stringValue, sizeof stringValue, "%llu", lastSeenID); 166 | asl_set_query(query, ASL_KEY_MSG_ID, stringValue, ASL_QUERY_OP_GREATER | ASL_QUERY_OP_NUMERIC); 167 | } else { 168 | snprintf(stringValue, sizeof stringValue, "%llu", startTime); 169 | asl_set_query(query, ASL_KEY_TIME, stringValue, ASL_QUERY_OP_GREATER_EQUAL | ASL_QUERY_OP_NUMERIC); 170 | } 171 | 172 | [self configureAslQuery:query]; 173 | 174 | // Iterate over new messages. 175 | aslmsg msg; 176 | aslresponse response = asl_search(NULL, query); 177 | 178 | while ((msg = asl_next(response))) 179 | { 180 | [self aslMessageReceived:msg]; 181 | 182 | // Keep track of which messages we've seen. 183 | lastSeenID = (unsigned long long)atoll(asl_get(msg, ASL_KEY_MSG_ID)); 184 | } 185 | asl_release(response); 186 | asl_free(query); 187 | 188 | if (_cancel) { 189 | notify_cancel(token); 190 | return; 191 | } 192 | 193 | } 194 | }); 195 | } 196 | } 197 | 198 | @end 199 | 200 | #endif 201 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import 24 | 25 | // Custom key set on messages sent to ASL 26 | extern const char* const kDDASLKeyDDLog; 27 | 28 | // Value set for kDDASLKeyDDLog 29 | extern const char* const kDDASLDDLogValue; 30 | 31 | /** 32 | * This class provides a logger for the Apple System Log facility. 33 | * 34 | * As described in the "Getting Started" page, 35 | * the traditional NSLog() function directs its output to two places: 36 | * 37 | * - Apple System Log 38 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 39 | * 40 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 41 | * However, if you instead choose to use file logging (for faster performance), 42 | * you may choose to use a file logger and a tty logger. 43 | **/ 44 | API_DEPRECATED("Use DDOSLogger instead", macosx(10.4,10.12), ios(2.0,10.0), watchos(2.0,3.0), tvos(9.0,10.0)) 45 | @interface DDASLLogger : DDAbstractLogger 46 | 47 | /** 48 | * Singleton method 49 | * 50 | * @return the shared instance 51 | */ 52 | @property (class, readonly, strong) DDASLLogger *sharedInstance; 53 | 54 | // Inherited from DDAbstractLogger 55 | 56 | // - (id )logFormatter; 57 | // - (void)setLogFormatter:(id )formatter; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogger.h" 17 | 18 | #if !TARGET_OS_WATCH 19 | #import 20 | 21 | #if !__has_feature(objc_arc) 22 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 23 | #endif 24 | 25 | const char* const kDDASLKeyDDLog = "DDLog"; 26 | 27 | const char* const kDDASLDDLogValue = "1"; 28 | 29 | static DDASLLogger *sharedInstance; 30 | 31 | @interface DDASLLogger () { 32 | aslclient _client; 33 | } 34 | 35 | @end 36 | 37 | 38 | @implementation DDASLLogger 39 | 40 | + (instancetype)sharedInstance { 41 | static dispatch_once_t DDASLLoggerOnceToken; 42 | 43 | dispatch_once(&DDASLLoggerOnceToken, ^{ 44 | sharedInstance = [[[self class] alloc] init]; 45 | }); 46 | 47 | return sharedInstance; 48 | } 49 | 50 | - (instancetype)init { 51 | if (sharedInstance != nil) { 52 | return nil; 53 | } 54 | 55 | if ((self = [super init])) { 56 | // A default asl client is provided for the main thread, 57 | // but background threads need to create their own client. 58 | 59 | _client = asl_open(NULL, "com.apple.console", 0); 60 | } 61 | 62 | return self; 63 | } 64 | 65 | - (void)logMessage:(DDLogMessage *)logMessage { 66 | // Skip captured log messages 67 | if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { 68 | return; 69 | } 70 | 71 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 72 | 73 | if (message) { 74 | const char *msg = [message UTF8String]; 75 | 76 | size_t aslLogLevel; 77 | switch (logMessage->_flag) { 78 | // Note: By default ASL will filter anything above level 5 (Notice). 79 | // So our mappings shouldn't go above that level. 80 | case DDLogFlagError : aslLogLevel = ASL_LEVEL_CRIT; break; 81 | case DDLogFlagWarning : aslLogLevel = ASL_LEVEL_ERR; break; 82 | case DDLogFlagInfo : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level 83 | case DDLogFlagDebug : 84 | case DDLogFlagVerbose : 85 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 86 | } 87 | 88 | static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; 89 | 90 | // NSLog uses the current euid to set the ASL_KEY_READ_UID. 91 | uid_t const readUID = geteuid(); 92 | 93 | char readUIDString[16]; 94 | #ifndef NS_BLOCK_ASSERTIONS 95 | size_t l = (size_t)snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 96 | #else 97 | snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 98 | #endif 99 | 100 | NSAssert(l < sizeof(readUIDString), 101 | @"Formatted euid is too long."); 102 | NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), 103 | @"Unhandled ASL log level."); 104 | 105 | aslmsg m = asl_new(ASL_TYPE_MSG); 106 | if (m != NULL) { 107 | if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && 108 | asl_set(m, ASL_KEY_MSG, msg) == 0 && 109 | asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0 && 110 | asl_set(m, kDDASLKeyDDLog, kDDASLDDLogValue) == 0) { 111 | asl_send(_client, m); 112 | } 113 | asl_free(m); 114 | } 115 | //TODO handle asl_* failures non-silently? 116 | } 117 | } 118 | 119 | - (DDLoggerName)loggerName { 120 | return DDLoggerNameASL; 121 | } 122 | 123 | @end 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import 22 | 23 | /** 24 | * This class provides an abstract implementation of a database logger. 25 | * 26 | * That is, it provides the base implementation for a database logger to build atop of. 27 | * All that is needed for a concrete database logger is to extend this class 28 | * and override the methods in the implementation file that are prefixed with "db_". 29 | **/ 30 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 31 | 32 | @protected 33 | NSUInteger _saveThreshold; 34 | NSTimeInterval _saveInterval; 35 | NSTimeInterval _maxAge; 36 | NSTimeInterval _deleteInterval; 37 | BOOL _deleteOnEverySave; 38 | 39 | BOOL _saveTimerSuspended; 40 | NSUInteger _unsavedCount; 41 | dispatch_time_t _unsavedTime; 42 | dispatch_source_t _saveTimer; 43 | dispatch_time_t _lastDeleteTime; 44 | dispatch_source_t _deleteTimer; 45 | } 46 | 47 | /** 48 | * Specifies how often to save the data to disk. 49 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 50 | * These properties allow you to configure how/when the logger saves to disk. 51 | * 52 | * A save is done when either (whichever happens first): 53 | * 54 | * - The number of unsaved log entries reaches saveThreshold 55 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 56 | * 57 | * You can optionally disable the saveThreshold by setting it to zero. 58 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 59 | * 60 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 61 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 62 | * 63 | * It's not wise to disable both saveThreshold and saveInterval. 64 | * 65 | * The default saveThreshold is 500. 66 | * The default saveInterval is 60 seconds. 67 | **/ 68 | @property (assign, readwrite) NSUInteger saveThreshold; 69 | 70 | /** 71 | * See the description for the `saveThreshold` property 72 | */ 73 | @property (assign, readwrite) NSTimeInterval saveInterval; 74 | 75 | /** 76 | * It is likely you don't want the log entries to persist forever. 77 | * Doing so would allow the database to grow infinitely large over time. 78 | * 79 | * The maxAge property provides a way to specify how old a log statement can get 80 | * before it should get deleted from the database. 81 | * 82 | * The deleteInterval specifies how often to sweep for old log entries. 83 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 84 | * 85 | * An alternative to the deleteInterval is the deleteOnEverySave option. 86 | * This specifies that old log entries should be deleted during every save operation. 87 | * 88 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 89 | * If you disable the maxAge then old log statements are not deleted. 90 | * 91 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 92 | * 93 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 94 | * 95 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 96 | * 97 | * The default maxAge is 7 days. 98 | * The default deleteInterval is 5 minutes. 99 | * The default deleteOnEverySave is NO. 100 | **/ 101 | @property (assign, readwrite) NSTimeInterval maxAge; 102 | 103 | /** 104 | * See the description for the `maxAge` property 105 | */ 106 | @property (assign, readwrite) NSTimeInterval deleteInterval; 107 | 108 | /** 109 | * See the description for the `maxAge` property 110 | */ 111 | @property (assign, readwrite) BOOL deleteOnEverySave; 112 | 113 | /** 114 | * Forces a save of any pending log entries (flushes log entries to disk). 115 | **/ 116 | - (void)savePendingLogEntries; 117 | 118 | /** 119 | * Removes any log entries that are older than maxAge. 120 | **/ 121 | - (void)deleteOldLogEntries; 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * NSAssert replacement that will output a log message even when assertions are disabled. 18 | **/ 19 | #define DDAssert(condition, frmt, ...) \ 20 | if (!(condition)) { \ 21 | NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ 22 | DDLogError(@"%@", description); \ 23 | NSAssert(NO, @"%@", description); \ 24 | } 25 | #define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) 26 | 27 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDFileLogger+Internal.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface DDFileLogger (Internal) 21 | 22 | - (void)logData:(NSData *)data; 23 | 24 | // Will assert if used outside logger's queue. 25 | - (void)lt_logData:(NSData *)data; 26 | 27 | - (NSData *)lt_dataForMessage:(DDLogMessage *)message; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDLegacyMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Legacy macros used for 1.9.x backwards compatibility. 18 | * 19 | * Imported by default when importing a DDLog.h directly and DD_LEGACY_MACROS is not defined and set to 0. 20 | **/ 21 | #if DD_LEGACY_MACROS 22 | 23 | #warning CocoaLumberjack 1.9.x legacy macros enabled. \ 24 | Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h. 25 | 26 | #ifndef LOG_LEVEL_DEF 27 | #define LOG_LEVEL_DEF ddLogLevel 28 | #endif 29 | 30 | #define LOG_FLAG_ERROR DDLogFlagError 31 | #define LOG_FLAG_WARN DDLogFlagWarning 32 | #define LOG_FLAG_INFO DDLogFlagInfo 33 | #define LOG_FLAG_DEBUG DDLogFlagDebug 34 | #define LOG_FLAG_VERBOSE DDLogFlagVerbose 35 | 36 | #define LOG_LEVEL_OFF DDLogLevelOff 37 | #define LOG_LEVEL_ERROR DDLogLevelError 38 | #define LOG_LEVEL_WARN DDLogLevelWarning 39 | #define LOG_LEVEL_INFO DDLogLevelInfo 40 | #define LOG_LEVEL_DEBUG DDLogLevelDebug 41 | #define LOG_LEVEL_VERBOSE DDLogLevelVerbose 42 | #define LOG_LEVEL_ALL DDLogLevelAll 43 | 44 | #define LOG_ASYNC_ENABLED YES 45 | 46 | #define LOG_ASYNC_ERROR ( NO && LOG_ASYNC_ENABLED) 47 | #define LOG_ASYNC_WARN (YES && LOG_ASYNC_ENABLED) 48 | #define LOG_ASYNC_INFO (YES && LOG_ASYNC_ENABLED) 49 | #define LOG_ASYNC_DEBUG (YES && LOG_ASYNC_ENABLED) 50 | #define LOG_ASYNC_VERBOSE (YES && LOG_ASYNC_ENABLED) 51 | 52 | #define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 53 | [DDLog log : isAsynchronous \ 54 | level : lvl \ 55 | flag : flg \ 56 | context : ctx \ 57 | file : __FILE__ \ 58 | function : fnct \ 59 | line : __LINE__ \ 60 | tag : atag \ 61 | format : (frmt), ## __VA_ARGS__] 62 | 63 | #define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \ 64 | do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0) 65 | 66 | #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \ 67 | LOG_MAYBE(async, lvl, flg, ctx, __PRETTY_FUNCTION__, frmt, ## __VA_ARGS__) 68 | 69 | #define DDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__) 70 | #define DDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__) 71 | #define DDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__) 72 | #define DDLogDebug(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ##__VA_ARGS__) 73 | #define DDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__) 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import 22 | 23 | /** 24 | * The constant/variable/method responsible for controlling the current log level. 25 | **/ 26 | #ifndef LOG_LEVEL_DEF 27 | #define LOG_LEVEL_DEF ddLogLevel 28 | #endif 29 | 30 | /** 31 | * Whether async should be used by log messages, excluding error messages that are always sent sync. 32 | **/ 33 | #ifndef LOG_ASYNC_ENABLED 34 | #define LOG_ASYNC_ENABLED YES 35 | #endif 36 | 37 | /** 38 | * This is the single macro that all other macros below compile into. 39 | * This big multiline macro makes all the other macros easier to read. 40 | **/ 41 | #define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \ 42 | [DDLog log : isAsynchronous \ 43 | level : lvl \ 44 | flag : flg \ 45 | context : ctx \ 46 | file : __FILE__ \ 47 | function : fnct \ 48 | line : __LINE__ \ 49 | tag : atag \ 50 | format : frmt \ 51 | args : avalist] 52 | 53 | /** 54 | * Define version of the macro that only execute if the log level is above the threshold. 55 | * The compiled versions essentially look like this: 56 | * 57 | * if (logFlagForThisLogMsg & ddLogLevel) { execute log message } 58 | * 59 | * When LOG_LEVEL_DEF is defined as ddLogLevel. 60 | * 61 | * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels. 62 | * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques. 63 | * 64 | * Note that when compiler optimizations are enabled (as they are for your release builds), 65 | * the log messages above your logging threshold will automatically be compiled out. 66 | * 67 | * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see 68 | * if the 'if' statement would execute, and if not it strips it from the binary.) 69 | * 70 | * We also define shorthand versions for asynchronous and synchronous logging. 71 | **/ 72 | #define LOGV_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, avalist) \ 73 | do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, avalist); } while(0) 74 | 75 | /** 76 | * Ready to use log macros with no context or tag. 77 | **/ 78 | #define DDLogVError(frmt, avalist) LOGV_MAYBE(NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 79 | #define DDLogVWarn(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 80 | #define DDLogVInfo(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 81 | #define DDLogVDebug(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 82 | #define DDLogVVerbose(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 83 | 84 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDLogMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import 22 | 23 | /** 24 | * The constant/variable/method responsible for controlling the current log level. 25 | **/ 26 | #ifndef LOG_LEVEL_DEF 27 | #define LOG_LEVEL_DEF ddLogLevel 28 | #endif 29 | 30 | /** 31 | * Whether async should be used by log messages, excluding error messages that are always sent sync. 32 | **/ 33 | #ifndef LOG_ASYNC_ENABLED 34 | #define LOG_ASYNC_ENABLED YES 35 | #endif 36 | 37 | /** 38 | * These are the two macros that all other macros below compile into. 39 | * These big multiline macros makes all the other macros easier to read. 40 | **/ 41 | #define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 42 | [DDLog log : isAsynchronous \ 43 | level : lvl \ 44 | flag : flg \ 45 | context : ctx \ 46 | file : __FILE__ \ 47 | function : fnct \ 48 | line : __LINE__ \ 49 | tag : atag \ 50 | format : (frmt), ## __VA_ARGS__] 51 | 52 | #define LOG_MACRO_TO_DDLOG(ddlog, isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 53 | [ddlog log : isAsynchronous \ 54 | level : lvl \ 55 | flag : flg \ 56 | context : ctx \ 57 | file : __FILE__ \ 58 | function : fnct \ 59 | line : __LINE__ \ 60 | tag : atag \ 61 | format : (frmt), ## __VA_ARGS__] 62 | 63 | /** 64 | * Define version of the macro that only execute if the log level is above the threshold. 65 | * The compiled versions essentially look like this: 66 | * 67 | * if (logFlagForThisLogMsg & ddLogLevel) { execute log message } 68 | * 69 | * When LOG_LEVEL_DEF is defined as ddLogLevel. 70 | * 71 | * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels. 72 | * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques. 73 | * 74 | * Note that when compiler optimizations are enabled (as they are for your release builds), 75 | * the log messages above your logging threshold will automatically be compiled out. 76 | * 77 | * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see 78 | * if the 'if' statement would execute, and if not it strips it from the binary.) 79 | * 80 | * We also define shorthand versions for asynchronous and synchronous logging. 81 | **/ 82 | #define LOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \ 83 | do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0) 84 | 85 | #define LOG_MAYBE_TO_DDLOG(ddlog, async, lvl, flg, ctx, tag, fnct, frmt, ...) \ 86 | do { if(lvl & flg) LOG_MACRO_TO_DDLOG(ddlog, async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0) 87 | 88 | /** 89 | * Ready to use log macros with no context or tag. 90 | **/ 91 | #define DDLogError(frmt, ...) LOG_MAYBE(NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 92 | #define DDLogWarn(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 93 | #define DDLogInfo(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 94 | #define DDLogDebug(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 95 | #define DDLogVerbose(frmt, ...) LOG_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 96 | 97 | #define DDLogErrorToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 98 | #define DDLogWarnToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 99 | #define DDLogInfoToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 100 | #define DDLogDebugToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 101 | #define DDLogVerboseToDDLog(ddlog, frmt, ...) LOG_MAYBE_TO_DDLOG(ddlog, LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__) 102 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDLoggerNames.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | typedef NSString *DDLoggerName NS_TYPED_EXTENSIBLE_ENUM; 21 | FOUNDATION_EXPORT DDLoggerName const DDLoggerNameASL NS_SWIFT_NAME(DDLoggerName.asl); // DDASLLogger 22 | FOUNDATION_EXPORT DDLoggerName const DDLoggerNameTTY NS_SWIFT_NAME(DDLoggerName.tty); // DDTTYLogger 23 | FOUNDATION_EXPORT DDLoggerName const DDLoggerNameOS NS_SWIFT_NAME(DDLoggerName.os); // DDOSLogger 24 | FOUNDATION_EXPORT DDLoggerName const DDLoggerNameFile NS_SWIFT_NAME(DDLoggerName.file); // DDFileLogger 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDLoggerNames.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDLoggerNames.h" 17 | 18 | DDLoggerName const DDLoggerNameASL = @"cocoa.lumberjack.aslLogger"; 19 | DDLoggerName const DDLoggerNameTTY = @"cocoa.lumberjack.ttyLogger"; 20 | DDLoggerName const DDLoggerNameOS = @"cocoa.lumberjack.osLogger"; 21 | DDLoggerName const DDLoggerNameFile = @"cocoa.lumberjack.fileLogger"; 22 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDOSLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import 24 | 25 | /** 26 | * This class provides a logger for the Apple os_log facility. 27 | **/ 28 | API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0)) 29 | @interface DDOSLogger : DDAbstractLogger 30 | 31 | /** 32 | * Singleton method 33 | * 34 | * @return the shared instance with OS_LOG_DEFAULT. 35 | */ 36 | @property (class, readonly, strong) DDOSLogger *sharedInstance; 37 | 38 | /** 39 | Designed initializer 40 | 41 | @param subsystem Desired subsystem in log. Consider "org.example" 42 | @param category Desired category in log. Consider "Point of interests." 43 | @return New instance of DDOSLogger. 44 | 45 | @discussion This method accepts parameters of type (String, String)? 46 | If both parameters are nil, this method will return logger wrapper for `OS_LOG_DEFAULT`. 47 | If both parameters are not nil, it will return logger wrapper for `os_log_create(subsystem, category)` 48 | */ 49 | - (instancetype)initWithSubsystem:(NSString *)subsystem category:(NSString *)category NS_DESIGNATED_INITIALIZER; 50 | @end 51 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDOSLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDOSLogger.h" 17 | 18 | #import 19 | 20 | @interface DDOSLogger () { 21 | NSString *_subsystem; 22 | NSString *_category; 23 | } 24 | @property (copy, nonatomic, readonly) NSString *subsystem; 25 | @property (copy, nonatomic, readonly) NSString *category; 26 | @property (strong, nonatomic, readwrite) os_log_t logger; 27 | @end 28 | 29 | @implementation DDOSLogger 30 | 31 | @synthesize subsystem = _subsystem; 32 | @synthesize category = _category; 33 | 34 | #pragma mark - Initialization 35 | 36 | /** 37 | * Assertion 38 | * Swift: (String, String)? 39 | */ 40 | - (instancetype)initWithSubsystem:(NSString *)subsystem category:(NSString *)category { 41 | NSAssert((subsystem == nil) == (category == nil), @"Either both subsystem and category or neither can be nil."); 42 | if (self = [super init]) { 43 | _subsystem = [subsystem copy]; 44 | _category = [category copy]; 45 | } 46 | return self; 47 | } 48 | 49 | static DDOSLogger *sharedInstance; 50 | 51 | - (instancetype)init { 52 | return [self initWithSubsystem:nil category:nil]; 53 | } 54 | 55 | + (instancetype)sharedInstance { 56 | static dispatch_once_t DDOSLoggerOnceToken; 57 | 58 | dispatch_once(&DDOSLoggerOnceToken, ^{ 59 | sharedInstance = [[[self class] alloc] init]; 60 | }); 61 | 62 | return sharedInstance; 63 | } 64 | 65 | #pragma mark - os_log 66 | 67 | - (os_log_t)getLogger { 68 | if (self.subsystem == nil || self.category == nil) { 69 | return OS_LOG_DEFAULT; 70 | } 71 | __auto_type subdomain = self.subsystem.UTF8String; 72 | __auto_type category = self.category.UTF8String; 73 | return os_log_create(subdomain, category); 74 | } 75 | 76 | - (os_log_t)logger { 77 | if (_logger == nil) { 78 | _logger = [self getLogger]; 79 | } 80 | return _logger; 81 | } 82 | 83 | #pragma mark - DDLogger 84 | 85 | - (void)logMessage:(DDLogMessage *)logMessage { 86 | // Skip captured log messages 87 | if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { 88 | return; 89 | } 90 | 91 | if(@available(iOS 10.0, macOS 10.12, tvOS 10.0, watchOS 3.0, *)) { 92 | 93 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 94 | if (message != nil) { 95 | const char *msg = [message UTF8String]; 96 | __auto_type logger = [self logger]; 97 | switch (logMessage->_flag) { 98 | case DDLogFlagError : 99 | os_log_error(logger, "%{public}s", msg); 100 | break; 101 | case DDLogFlagWarning : 102 | case DDLogFlagInfo : 103 | os_log_info(logger, "%{public}s", msg); 104 | break; 105 | case DDLogFlagDebug : 106 | case DDLogFlagVerbose : 107 | default : 108 | os_log_debug(logger, "%{public}s", msg); 109 | break; 110 | } 111 | } 112 | 113 | } 114 | 115 | } 116 | 117 | - (DDLoggerName)loggerName { 118 | return DDLoggerNameOS; 119 | } 120 | @end 121 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/DDTTYLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import 22 | 23 | #define LOG_CONTEXT_ALL INT_MAX 24 | 25 | #pragma clang diagnostic push 26 | #pragma clang diagnostic ignored "-Wunused-function" 27 | #if !(TARGET_OS_OSX) 28 | // iOS or tvOS or watchOS 29 | #import 30 | typedef UIColor DDColor; 31 | static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} 32 | #elif defined(DD_CLI) || !__has_include() 33 | // OS X CLI 34 | #import 35 | typedef CLIColor DDColor; 36 | static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} 37 | #else 38 | // OS X with AppKit 39 | #import 40 | typedef NSColor DDColor; 41 | static inline DDColor* DDMakeColor(CGFloat r, CGFloat g, CGFloat b) {return [DDColor colorWithCalibratedRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f];} 42 | #endif 43 | #pragma clang diagnostic pop 44 | 45 | 46 | /** 47 | * This class provides a logger for Terminal output or Xcode console output, 48 | * depending on where you are running your code. 49 | * 50 | * As described in the "Getting Started" page, 51 | * the traditional NSLog() function directs it's output to two places: 52 | * 53 | * - Apple System Log (so it shows up in Console.app) 54 | * - StdErr (if stderr is a TTY, so log statements show up in Xcode console) 55 | * 56 | * To duplicate NSLog() functionality you can simply add this logger and an asl logger. 57 | * However, if you instead choose to use file logging (for faster performance), 58 | * you may choose to use only a file logger and a tty logger. 59 | **/ 60 | @interface DDTTYLogger : DDAbstractLogger 61 | 62 | /** 63 | * Singleton method 64 | */ 65 | @property (class, readonly, strong) DDTTYLogger *sharedInstance; 66 | 67 | /* Inherited from the DDLogger protocol: 68 | * 69 | * Formatters may optionally be added to any logger. 70 | * 71 | * If no formatter is set, the logger simply logs the message as it is given in logMessage, 72 | * or it may use its own built in formatting style. 73 | * 74 | * More information about formatters can be found here: 75 | * Documentation/CustomFormatters.md 76 | * 77 | * The actual implementation of these methods is inherited from DDAbstractLogger. 78 | 79 | - (id )logFormatter; 80 | - (void)setLogFormatter:(id )formatter; 81 | 82 | */ 83 | 84 | /** 85 | * Want to use different colors for different log levels? 86 | * Enable this property. 87 | * 88 | * If you run the application via the Terminal (not Xcode), 89 | * the logger will map colors to xterm-256color or xterm-color (if available). 90 | * 91 | * Xcode does NOT natively support colors in the Xcode debugging console. 92 | * You'll need to install the XcodeColors plugin to see colors in the Xcode console. 93 | * https://github.com/robbiehanson/XcodeColors 94 | * 95 | * The default value is NO. 96 | **/ 97 | @property (readwrite, assign) BOOL colorsEnabled; 98 | 99 | /** 100 | * When using a custom formatter you can set the `logMessage` method not to append 101 | * `\n` character after each output. This allows for some greater flexibility with 102 | * custom formatters. Default value is YES. 103 | **/ 104 | @property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters; 105 | 106 | /** 107 | * The default color set (foregroundColor, backgroundColor) is: 108 | * 109 | * - DDLogFlagError = (red, nil) 110 | * - DDLogFlagWarning = (orange, nil) 111 | * 112 | * You can customize the colors however you see fit. 113 | * Please note that you are passing a flag, NOT a level. 114 | * 115 | * GOOD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:DDLogFlagInfo]; // <- Good :) 116 | * BAD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:DDLogLevelInfo]; // <- BAD! :( 117 | * 118 | * DDLogFlagInfo = 0...00100 119 | * DDLogLevelInfo = 0...00111 <- Would match DDLogFlagInfo and DDLogFlagWarning and DDLogFlagError 120 | * 121 | * If you run the application within Xcode, then the XcodeColors plugin is required. 122 | * 123 | * If you run the application from a shell, then DDTTYLogger will automatically map the given color to 124 | * the closest available color. (xterm-256color or xterm-color which have 256 and 16 supported colors respectively.) 125 | * 126 | * This method invokes setForegroundColor:backgroundColor:forFlag:context: and applies it to `LOG_CONTEXT_ALL`. 127 | **/ 128 | - (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forFlag:(DDLogFlag)mask; 129 | 130 | /** 131 | * Just like setForegroundColor:backgroundColor:flag, but allows you to specify a particular logging context. 132 | * 133 | * A logging context is often used to identify log messages coming from a 3rd party framework, 134 | * although logging context's can be used for many different functions. 135 | * 136 | * Use LOG_CONTEXT_ALL to set the default color for all contexts that have no specific color set defined. 137 | * 138 | * Logging context's are explained in further detail here: 139 | * Documentation/CustomContext.md 140 | **/ 141 | - (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forFlag:(DDLogFlag)mask context:(NSInteger)ctxt; 142 | 143 | /** 144 | * Similar to the methods above, but allows you to map DDLogMessage->tag to a particular color profile. 145 | * For example, you could do something like this: 146 | * 147 | * static NSString *const PurpleTag = @"PurpleTag"; 148 | * 149 | * #define DDLogPurple(frmt, ...) LOG_OBJC_TAG_MACRO(NO, 0, 0, 0, PurpleTag, frmt, ##__VA_ARGS__) 150 | * 151 | * And then where you configure CocoaLumberjack: 152 | * 153 | * purple = DDMakeColor((64/255.0), (0/255.0), (128/255.0)); 154 | * 155 | * or any UIColor/NSColor constructor. 156 | * 157 | * Note: For CLI OS X projects that don't link with AppKit use CLIColor objects instead 158 | * 159 | * [[DDTTYLogger sharedInstance] setForegroundColor:purple backgroundColor:nil forTag:PurpleTag]; 160 | * [DDLog addLogger:[DDTTYLogger sharedInstance]]; 161 | * 162 | * This would essentially give you a straight NSLog replacement that prints in purple: 163 | * 164 | * DDLogPurple(@"I'm a purple log message!"); 165 | **/ 166 | - (void)setForegroundColor:(DDColor *)txtColor backgroundColor:(DDColor *)bgColor forTag:(id )tag; 167 | 168 | /** 169 | * Clearing color profiles. 170 | **/ 171 | - (void)clearColorsForFlag:(DDLogFlag)mask; 172 | - (void)clearColorsForFlag:(DDLogFlag)mask context:(NSInteger)context; 173 | - (void)clearColorsForTag:(id )tag; 174 | - (void)clearColorsForAllFlags; 175 | - (void)clearColorsForAllTags; 176 | - (void)clearAllColors; 177 | 178 | @end 179 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import 24 | 25 | /** 26 | * This class provides a log formatter that filters log statements from a logging context not on the whitelist. 27 | * 28 | * A log formatter can be added to any logger to format and/or filter its output. 29 | * You can learn more about log formatters here: 30 | * Documentation/CustomFormatters.md 31 | * 32 | * You can learn more about logging context's here: 33 | * Documentation/CustomContext.md 34 | * 35 | * But here's a quick overview / refresher: 36 | * 37 | * Every log statement has a logging context. 38 | * These come from the underlying logging macros defined in DDLog.h. 39 | * The default logging context is zero. 40 | * You can define multiple logging context's for use in your application. 41 | * For example, logically separate parts of your app each have a different logging context. 42 | * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. 43 | **/ 44 | @interface DDContextWhitelistFilterLogFormatter : NSObject 45 | 46 | /** 47 | * Designated default initializer 48 | */ 49 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 50 | 51 | /** 52 | * Add a context to the whitelist 53 | * 54 | * @param loggingContext the context 55 | */ 56 | - (void)addToWhitelist:(NSInteger)loggingContext; 57 | 58 | /** 59 | * Remove context from whitelist 60 | * 61 | * @param loggingContext the context 62 | */ 63 | - (void)removeFromWhitelist:(NSInteger)loggingContext; 64 | 65 | /** 66 | * Return the whitelist 67 | */ 68 | @property (readonly, copy) NSArray *whitelist; 69 | 70 | /** 71 | * Check if a context is on the whitelist 72 | * 73 | * @param loggingContext the context 74 | */ 75 | - (BOOL)isOnWhitelist:(NSInteger)loggingContext; 76 | 77 | @end 78 | 79 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 80 | #pragma mark - 81 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 82 | 83 | /** 84 | * This class provides a log formatter that filters log statements from a logging context on the blacklist. 85 | **/ 86 | @interface DDContextBlacklistFilterLogFormatter : NSObject 87 | 88 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 89 | 90 | /** 91 | * Add a context to the blacklist 92 | * 93 | * @param loggingContext the context 94 | */ 95 | - (void)addToBlacklist:(NSInteger)loggingContext; 96 | 97 | /** 98 | * Remove context from blacklist 99 | * 100 | * @param loggingContext the context 101 | */ 102 | - (void)removeFromBlacklist:(NSInteger)loggingContext; 103 | 104 | /** 105 | * Return the blacklist 106 | */ 107 | @property (readonly, copy) NSArray *blacklist; 108 | 109 | 110 | /** 111 | * Check if a context is on the blacklist 112 | * 113 | * @param loggingContext the context 114 | */ 115 | - (BOOL)isOnBlacklist:(NSInteger)loggingContext; 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDContextFilterLogFormatter.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDContextFilterLogFormatter.h" 17 | #import 18 | 19 | #if !__has_feature(objc_arc) 20 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 21 | #endif 22 | 23 | @interface DDLoggingContextSet : NSObject 24 | 25 | - (void)addToSet:(NSInteger)loggingContext; 26 | - (void)removeFromSet:(NSInteger)loggingContext; 27 | 28 | @property (readonly, copy) NSArray *currentSet; 29 | 30 | - (BOOL)isInSet:(NSInteger)loggingContext; 31 | 32 | @end 33 | 34 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 35 | #pragma mark - 36 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 37 | 38 | @interface DDContextWhitelistFilterLogFormatter () { 39 | DDLoggingContextSet *_contextSet; 40 | } 41 | 42 | @end 43 | 44 | 45 | @implementation DDContextWhitelistFilterLogFormatter 46 | 47 | - (instancetype)init { 48 | if ((self = [super init])) { 49 | _contextSet = [[DDLoggingContextSet alloc] init]; 50 | } 51 | 52 | return self; 53 | } 54 | 55 | - (void)addToWhitelist:(NSInteger)loggingContext { 56 | [_contextSet addToSet:loggingContext]; 57 | } 58 | 59 | - (void)removeFromWhitelist:(NSInteger)loggingContext { 60 | [_contextSet removeFromSet:loggingContext]; 61 | } 62 | 63 | - (NSArray *)whitelist { 64 | return [_contextSet currentSet]; 65 | } 66 | 67 | - (BOOL)isOnWhitelist:(NSInteger)loggingContext { 68 | return [_contextSet isInSet:loggingContext]; 69 | } 70 | 71 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 72 | if ([self isOnWhitelist:logMessage->_context]) { 73 | return logMessage->_message; 74 | } else { 75 | return nil; 76 | } 77 | } 78 | 79 | @end 80 | 81 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 82 | #pragma mark - 83 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 84 | 85 | @interface DDContextBlacklistFilterLogFormatter () { 86 | DDLoggingContextSet *_contextSet; 87 | } 88 | 89 | @end 90 | 91 | 92 | @implementation DDContextBlacklistFilterLogFormatter 93 | 94 | - (instancetype)init { 95 | if ((self = [super init])) { 96 | _contextSet = [[DDLoggingContextSet alloc] init]; 97 | } 98 | 99 | return self; 100 | } 101 | 102 | - (void)addToBlacklist:(NSInteger)loggingContext { 103 | [_contextSet addToSet:loggingContext]; 104 | } 105 | 106 | - (void)removeFromBlacklist:(NSInteger)loggingContext { 107 | [_contextSet removeFromSet:loggingContext]; 108 | } 109 | 110 | - (NSArray *)blacklist { 111 | return [_contextSet currentSet]; 112 | } 113 | 114 | - (BOOL)isOnBlacklist:(NSInteger)loggingContext { 115 | return [_contextSet isInSet:loggingContext]; 116 | } 117 | 118 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 119 | if ([self isOnBlacklist:logMessage->_context]) { 120 | return nil; 121 | } else { 122 | return logMessage->_message; 123 | } 124 | } 125 | 126 | @end 127 | 128 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 129 | #pragma mark - 130 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 131 | 132 | 133 | @interface DDLoggingContextSet () { 134 | pthread_mutex_t _mutex; 135 | NSMutableSet *_set; 136 | } 137 | 138 | @end 139 | 140 | 141 | @implementation DDLoggingContextSet 142 | 143 | - (instancetype)init { 144 | if ((self = [super init])) { 145 | _set = [[NSMutableSet alloc] init]; 146 | pthread_mutex_init(&_mutex, NULL); 147 | } 148 | 149 | return self; 150 | } 151 | 152 | - (void)dealloc { 153 | pthread_mutex_destroy(&_mutex); 154 | } 155 | 156 | - (void)addToSet:(NSInteger)loggingContext { 157 | pthread_mutex_lock(&_mutex); 158 | { 159 | [_set addObject:@(loggingContext)]; 160 | } 161 | pthread_mutex_unlock(&_mutex); 162 | } 163 | 164 | - (void)removeFromSet:(NSInteger)loggingContext { 165 | pthread_mutex_lock(&_mutex); 166 | { 167 | [_set removeObject:@(loggingContext)]; 168 | } 169 | pthread_mutex_unlock(&_mutex); 170 | } 171 | 172 | - (NSArray *)currentSet { 173 | NSArray *result = nil; 174 | 175 | pthread_mutex_lock(&_mutex); 176 | { 177 | result = [_set allObjects]; 178 | } 179 | pthread_mutex_unlock(&_mutex); 180 | 181 | return result; 182 | } 183 | 184 | - (BOOL)isInSet:(NSInteger)loggingContext { 185 | BOOL result = NO; 186 | 187 | pthread_mutex_lock(&_mutex); 188 | { 189 | result = [_set containsObject:@(loggingContext)]; 190 | } 191 | pthread_mutex_unlock(&_mutex); 192 | 193 | return result; 194 | } 195 | 196 | @end 197 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDDispatchQueueLogFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import 24 | 25 | /** 26 | * Log formatter mode 27 | */ 28 | typedef NS_ENUM(NSUInteger, DDDispatchQueueLogFormatterMode){ 29 | /** 30 | * This is the default option, means the formatter can be reused between multiple loggers and therefore is thread-safe. 31 | * There is, of course, a performance cost for the thread-safety 32 | */ 33 | DDDispatchQueueLogFormatterModeShareble = 0, 34 | /** 35 | * If the formatter will only be used by a single logger, then the thread-safety can be removed 36 | * @note: there is an assert checking if the formatter is added to multiple loggers and the mode is non-shareble 37 | */ 38 | DDDispatchQueueLogFormatterModeNonShareble, 39 | }; 40 | 41 | 42 | /** 43 | * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. 44 | * 45 | * A log formatter can be added to any logger to format and/or filter its output. 46 | * You can learn more about log formatters here: 47 | * Documentation/CustomFormatters.md 48 | * 49 | * A typical `NSLog` (or `DDTTYLogger`) prints detailed info as `[:]`. 50 | * For example: 51 | * 52 | * `2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here` 53 | * 54 | * Where: 55 | * `- 19928 = process id` 56 | * `- 5207 = thread id (mach_thread_id printed in hex)` 57 | * 58 | * When using grand central dispatch (GCD), this information is less useful. 59 | * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. 60 | * For example: 61 | * 62 | * `2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue` 63 | * `2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue` 64 | * `2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue` 65 | * 66 | * This formatter allows you to replace the standard `[box:info]` with the dispatch_queue name. 67 | * For example: 68 | * 69 | * `2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue` 70 | * `2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue` 71 | * `2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue` 72 | * 73 | * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. 74 | * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). 75 | * 76 | * Note: If manually creating your own background threads (via `NSThread/alloc/init` or `NSThread/detachNeThread`), 77 | * you can use `[[NSThread currentThread] setName:(NSString *)]`. 78 | **/ 79 | @interface DDDispatchQueueLogFormatter : NSObject 80 | 81 | /** 82 | * Standard init method. 83 | * Configure using properties as desired. 84 | **/ 85 | - (instancetype)init NS_DESIGNATED_INITIALIZER; 86 | 87 | /** 88 | * Initializer with ability to set the queue mode 89 | * 90 | * @param mode choose between DDDispatchQueueLogFormatterModeShareble and DDDispatchQueueLogFormatterModeNonShareble, depending if the formatter is shared between several loggers or not 91 | */ 92 | - (instancetype)initWithMode:(DDDispatchQueueLogFormatterMode)mode; 93 | 94 | /** 95 | * The minQueueLength restricts the minimum size of the [detail box]. 96 | * If the minQueueLength is set to 0, there is no restriction. 97 | * 98 | * For example, say a dispatch_queue has a label of "diskIO": 99 | * 100 | * If the minQueueLength is 0: [diskIO] 101 | * If the minQueueLength is 4: [diskIO] 102 | * If the minQueueLength is 5: [diskIO] 103 | * If the minQueueLength is 6: [diskIO] 104 | * If the minQueueLength is 7: [diskIO ] 105 | * If the minQueueLength is 8: [diskIO ] 106 | * 107 | * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). 108 | * 109 | * If you want every [detail box] to have the exact same width, 110 | * set both minQueueLength and maxQueueLength to the same value. 111 | **/ 112 | @property (assign, atomic) NSUInteger minQueueLength; 113 | 114 | /** 115 | * The maxQueueLength restricts the number of characters that will be inside the [detail box]. 116 | * If the maxQueueLength is 0, there is no restriction. 117 | * 118 | * For example, say a dispatch_queue has a label of "diskIO": 119 | * 120 | * If the maxQueueLength is 0: [diskIO] 121 | * If the maxQueueLength is 4: [disk] 122 | * If the maxQueueLength is 5: [diskI] 123 | * If the maxQueueLength is 6: [diskIO] 124 | * If the maxQueueLength is 7: [diskIO] 125 | * If the maxQueueLength is 8: [diskIO] 126 | * 127 | * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated). 128 | * 129 | * If you want every [detail box] to have the exact same width, 130 | * set both minQueueLength and maxQueueLength to the same value. 131 | **/ 132 | @property (assign, atomic) NSUInteger maxQueueLength; 133 | 134 | /** 135 | * Sometimes queue labels have long names like "com.apple.main-queue", 136 | * but you'd prefer something shorter like simply "main". 137 | * 138 | * This method allows you to set such preferred replacements. 139 | * The above example is set by default. 140 | * 141 | * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. 142 | **/ 143 | - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; 144 | 145 | /** 146 | * See the `replacementStringForQueueLabel:` description 147 | */ 148 | - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel; 149 | 150 | @end 151 | 152 | /** 153 | * Category on `DDDispatchQueueLogFormatter` to make method declarations easier to extend/modify 154 | **/ 155 | @interface DDDispatchQueueLogFormatter (OverridableMethods) 156 | 157 | /** 158 | * Date formatter default configuration 159 | */ 160 | - (void)configureDateFormatter:(NSDateFormatter *)dateFormatter; 161 | 162 | /** 163 | * Formatter method to transfrom from date to string 164 | */ 165 | - (NSString *)stringFromDate:(NSDate *)date; 166 | 167 | /** 168 | * Method to compute the queue thread label 169 | */ 170 | - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage; 171 | 172 | /** 173 | * The actual method that formats a message (transforms a `DDLogMessage` model into a printable string) 174 | */ 175 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage; 176 | 177 | @end 178 | 179 | #pragma mark - DDAtomicCounter 180 | 181 | @protocol DDAtomicCountable 182 | 183 | - (instancetype)initWithDefaultValue:(int32_t)defaultValue; 184 | - (int32_t)increment; 185 | - (int32_t)decrement; 186 | - (int32_t)value; 187 | 188 | @end 189 | 190 | @interface DDAtomicCounter: NSObject 191 | @end 192 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDFileLogger+Buffering.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface DDFileLogger (Buffering) 21 | 22 | - (instancetype)wrapWithBuffer; 23 | - (instancetype)unwrapFromBuffer; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDFileLogger+Buffering.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | #import 18 | 19 | #import 20 | 21 | static const NSUInteger kDDDefaultBufferSize = 4096; // 4 kB, block f_bsize on iphone7 22 | static const NSUInteger kDDMaxBufferSize = 1048576; // ~1 mB, f_iosize on iphone7 23 | 24 | // Reads attributes from base file system to determine buffer size. 25 | // see statfs in sys/mount.h for descriptions of f_iosize and f_bsize. 26 | // f_bsize == "default", and f_iosize == "max" 27 | static inline NSUInteger p_DDGetDefaultBufferSizeBytesMax(const BOOL max) { 28 | struct statfs *mountedFileSystems = NULL; 29 | int count = getmntinfo(&mountedFileSystems, 0); 30 | 31 | for (int i = 0; i < count; i++) { 32 | struct statfs mounted = mountedFileSystems[i]; 33 | const char *name = mounted.f_mntonname; 34 | 35 | // We can use 2 as max here, since any length > 1 will fail the if-statement. 36 | if (strnlen(name, 2) == 1 && *name == '/') { 37 | return max ? (NSUInteger)mounted.f_iosize : (NSUInteger)mounted.f_bsize; 38 | } 39 | } 40 | 41 | return max ? kDDMaxBufferSize : kDDDefaultBufferSize; 42 | } 43 | 44 | static NSUInteger DDGetMaxBufferSizeBytes() { 45 | static NSUInteger maxBufferSize = 0; 46 | static dispatch_once_t onceToken; 47 | dispatch_once(&onceToken, ^{ 48 | maxBufferSize = p_DDGetDefaultBufferSizeBytesMax(YES); 49 | }); 50 | return maxBufferSize; 51 | } 52 | 53 | static NSUInteger DDGetDefaultBufferSizeBytes() { 54 | static NSUInteger defaultBufferSize = 0; 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | defaultBufferSize = p_DDGetDefaultBufferSizeBytesMax(NO); 58 | }); 59 | return defaultBufferSize; 60 | } 61 | 62 | @interface DDBufferedProxy : NSProxy 63 | 64 | @property (nonatomic) DDFileLogger *fileLogger; 65 | @property (nonatomic) NSOutputStream *buffer; 66 | 67 | @property (nonatomic) NSUInteger maxBufferSizeBytes; 68 | @property (nonatomic) NSUInteger currentBufferSizeBytes; 69 | 70 | @end 71 | 72 | @implementation DDBufferedProxy 73 | 74 | - (instancetype)initWithFileLogger:(DDFileLogger *)fileLogger { 75 | _fileLogger = fileLogger; 76 | _maxBufferSizeBytes = DDGetDefaultBufferSizeBytes(); 77 | [self flushBuffer]; 78 | 79 | return self; 80 | } 81 | 82 | - (void)dealloc { 83 | dispatch_block_t block = ^{ 84 | [self lt_sendBufferedDataToFileLogger]; 85 | self.fileLogger = nil; 86 | }; 87 | 88 | if ([self->_fileLogger isOnInternalLoggerQueue]) { 89 | block(); 90 | } else { 91 | dispatch_sync(self->_fileLogger.loggerQueue, block); 92 | } 93 | } 94 | 95 | #pragma mark - Buffering 96 | 97 | - (void)flushBuffer { 98 | [_buffer close]; 99 | _buffer = [NSOutputStream outputStreamToMemory]; 100 | [_buffer open]; 101 | _currentBufferSizeBytes = 0; 102 | } 103 | 104 | - (void)lt_sendBufferedDataToFileLogger { 105 | NSData *data = [_buffer propertyForKey:NSStreamDataWrittenToMemoryStreamKey]; 106 | [_fileLogger lt_logData:data]; 107 | [self flushBuffer]; 108 | } 109 | 110 | #pragma mark - Logging 111 | 112 | - (void)logMessage:(DDLogMessage *)logMessage { 113 | NSData *data = [_fileLogger lt_dataForMessage:logMessage]; 114 | NSUInteger length = data.length; 115 | if (length == 0) { 116 | return; 117 | } 118 | 119 | #ifndef DEBUG 120 | __unused 121 | #endif 122 | NSInteger written = [_buffer write:[data bytes] maxLength:length]; 123 | NSAssert(written == (NSInteger)length, @"Failed to write to memory buffer."); 124 | 125 | _currentBufferSizeBytes += length; 126 | 127 | if (_currentBufferSizeBytes >= _maxBufferSizeBytes) { 128 | [self lt_sendBufferedDataToFileLogger]; 129 | } 130 | } 131 | 132 | - (void)flush { 133 | // This method is public. 134 | // We need to execute the rolling on our logging thread/queue. 135 | 136 | dispatch_block_t block = ^{ 137 | @autoreleasepool { 138 | [self lt_sendBufferedDataToFileLogger]; 139 | [self.fileLogger flush]; 140 | } 141 | }; 142 | 143 | // The design of this method is taken from the DDAbstractLogger implementation. 144 | // For extensive documentation please refer to the DDAbstractLogger implementation. 145 | 146 | if ([self.fileLogger isOnInternalLoggerQueue]) { 147 | block(); 148 | } else { 149 | dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue]; 150 | NSAssert(![self.fileLogger isOnGlobalLoggingQueue], @"Core architecture requirement failure"); 151 | 152 | dispatch_sync(globalLoggingQueue, ^{ 153 | dispatch_sync(self.fileLogger.loggerQueue, block); 154 | }); 155 | } 156 | } 157 | 158 | #pragma mark - Properties 159 | 160 | - (void)setMaxBufferSizeBytes:(NSUInteger)newBufferSizeBytes { 161 | _maxBufferSizeBytes = MIN(newBufferSizeBytes, DDGetMaxBufferSizeBytes()); 162 | } 163 | 164 | #pragma mark - Wrapping 165 | 166 | - (DDFileLogger *)wrapWithBuffer { 167 | return (DDFileLogger *)self; 168 | } 169 | 170 | - (DDFileLogger *)unwrapFromBuffer { 171 | return (DDFileLogger *)self.fileLogger; 172 | } 173 | 174 | #pragma mark - NSProxy 175 | 176 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { 177 | return [self.fileLogger methodSignatureForSelector:sel]; 178 | } 179 | 180 | - (BOOL)respondsToSelector:(SEL)aSelector { 181 | return [self.fileLogger respondsToSelector:aSelector]; 182 | } 183 | 184 | - (void)forwardInvocation:(NSInvocation *)invocation { 185 | [invocation invokeWithTarget:self.fileLogger]; 186 | } 187 | 188 | @end 189 | 190 | @implementation DDFileLogger (Buffering) 191 | 192 | - (instancetype)wrapWithBuffer { 193 | return (DDFileLogger *)[[DDBufferedProxy alloc] initWithFileLogger:self]; 194 | } 195 | 196 | - (instancetype)unwrapFromBuffer { 197 | return self; 198 | } 199 | 200 | @end 201 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDMultiFormatter.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import 24 | 25 | /** 26 | * This formatter can be used to chain different formatters together. 27 | * The log message will processed in the order of the formatters added. 28 | **/ 29 | @interface DDMultiFormatter : NSObject 30 | 31 | /** 32 | * Array of chained formatters 33 | */ 34 | @property (readonly) NSArray> *formatters; 35 | 36 | /** 37 | * Add a new formatter 38 | */ 39 | - (void)addFormatter:(id)formatter NS_SWIFT_NAME(add(_:)); 40 | 41 | /** 42 | * Remove a formatter 43 | */ 44 | - (void)removeFormatter:(id)formatter NS_SWIFT_NAME(remove(_:)); 45 | 46 | /** 47 | * Remove all existing formatters 48 | */ 49 | - (void)removeAllFormatters NS_SWIFT_NAME(removeAll()); 50 | 51 | /** 52 | * Check if a certain formatter is used 53 | */ 54 | - (BOOL)isFormattingWithFormatter:(id)formatter; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/Classes/Extensions/DDMultiFormatter.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2019, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDMultiFormatter.h" 17 | 18 | #if !__has_feature(objc_arc) 19 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 20 | #endif 21 | 22 | 23 | @interface DDMultiFormatter () { 24 | dispatch_queue_t _queue; 25 | NSMutableArray *_formatters; 26 | } 27 | 28 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message; 29 | 30 | @end 31 | 32 | 33 | @implementation DDMultiFormatter 34 | 35 | - (instancetype)init { 36 | self = [super init]; 37 | 38 | if (self) { 39 | _queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", DISPATCH_QUEUE_CONCURRENT); 40 | _formatters = [NSMutableArray new]; 41 | } 42 | 43 | return self; 44 | } 45 | 46 | #pragma mark Processing 47 | 48 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage { 49 | __block NSString *line = logMessage->_message; 50 | 51 | dispatch_sync(_queue, ^{ 52 | for (id formatter in self->_formatters) { 53 | DDLogMessage *message = [self logMessageForLine:line originalMessage:logMessage]; 54 | line = [formatter formatLogMessage:message]; 55 | 56 | if (!line) { 57 | break; 58 | } 59 | } 60 | }); 61 | 62 | return line; 63 | } 64 | 65 | - (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message { 66 | DDLogMessage *newMessage = [message copy]; 67 | 68 | newMessage->_message = line; 69 | return newMessage; 70 | } 71 | 72 | #pragma mark Formatters 73 | 74 | - (NSArray *)formatters { 75 | __block NSArray *formatters; 76 | 77 | dispatch_sync(_queue, ^{ 78 | formatters = [self->_formatters copy]; 79 | }); 80 | 81 | return formatters; 82 | } 83 | 84 | - (void)addFormatter:(id)formatter { 85 | dispatch_barrier_async(_queue, ^{ 86 | [self->_formatters addObject:formatter]; 87 | }); 88 | } 89 | 90 | - (void)removeFormatter:(id)formatter { 91 | dispatch_barrier_async(_queue, ^{ 92 | [self->_formatters removeObject:formatter]; 93 | }); 94 | } 95 | 96 | - (void)removeAllFormatters { 97 | dispatch_barrier_async(_queue, ^{ 98 | [self->_formatters removeAllObjects]; 99 | }); 100 | } 101 | 102 | - (BOOL)isFormattingWithFormatter:(id)formatter { 103 | __block BOOL hasFormatter; 104 | 105 | dispatch_sync(_queue, ^{ 106 | hasFormatter = [self->_formatters containsObject:formatter]; 107 | }); 108 | 109 | return hasFormatter; 110 | } 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/CocoaLumberjack/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2010-2019, Deusty, LLC 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 11 | 12 | 3. Neither the name of Deusty nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Deusty, LLC. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Local Podspecs/MLSLogger.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MLSLogger", 3 | "version": "1.0.0", 4 | "summary": "模块化日志管理工具", 5 | "description": "模块化日志管理工具", 6 | "homepage": "https://github.com/Minlison/MLSLogger.git", 7 | "license": "MIT", 8 | "authors": { 9 | "Minlison": "yuanhang.1991@163.com" 10 | }, 11 | "platforms": { 12 | "ios": "8.0" 13 | }, 14 | "static_framework": true, 15 | "source": { 16 | "git": "https://github.com/Minlison/MLSLogger.git", 17 | "tag": "v1.0.0" 18 | }, 19 | "documentation_url": "https://www.minlison.cn/article/mlslogger", 20 | "source_files": "Classes/**/*.{h,m}", 21 | "public_header_files": "Classes/**/MLSLogger.h", 22 | "requires_arc": true, 23 | "dependencies": { 24 | "CocoaLumberjack": [ 25 | ">= 3.5.2" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (3.5.3): 3 | - CocoaLumberjack/Core (= 3.5.3) 4 | - CocoaLumberjack/Core (3.5.3) 5 | - MLSLogger (1.0.0): 6 | - CocoaLumberjack (>= 3.5.2) 7 | 8 | DEPENDENCIES: 9 | - MLSLogger (from `../`) 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - CocoaLumberjack 14 | 15 | EXTERNAL SOURCES: 16 | MLSLogger: 17 | :path: "../" 18 | 19 | SPEC CHECKSUMS: 20 | CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947 21 | MLSLogger: c01a6100e48e88f907242a13652be022f6c26703 22 | 23 | PODFILE CHECKSUM: 0204bbb5ec6ae6ff311c424874d5e9f2c7d19d57 24 | 25 | COCOAPODS: 1.7.3 26 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.5.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CocoaLumberjack : NSObject 3 | @end 4 | @implementation PodsDummy_CocoaLumberjack 5 | @end 6 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "CocoaLumberjack.h" 14 | #import "DDAbstractDatabaseLogger.h" 15 | #import "DDASLLogCapture.h" 16 | #import "DDASLLogger.h" 17 | #import "DDAssertMacros.h" 18 | #import "DDFileLogger.h" 19 | #import "DDLegacyMacros.h" 20 | #import "DDLog+LOGV.h" 21 | #import "DDLog.h" 22 | #import "DDLoggerNames.h" 23 | #import "DDLogMacros.h" 24 | #import "DDOSLogger.h" 25 | #import "DDTTYLogger.h" 26 | #import "DDContextFilterLogFormatter.h" 27 | #import "DDDispatchQueueLogFormatter.h" 28 | #import "DDFileLogger+Buffering.h" 29 | #import "DDMultiFormatter.h" 30 | #import "CLIColor.h" 31 | 32 | FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; 33 | FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; 34 | 35 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack.modulemap: -------------------------------------------------------------------------------- 1 | framework module CocoaLumberjack { 2 | umbrella header "CocoaLumberjack-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CocoaLumberjack 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MLSLogger : NSObject 3 | @end 4 | @implementation PodsDummy_MLSLogger 5 | @end 6 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "MLSLogger.h" 14 | 15 | FOUNDATION_EXPORT double MLSLoggerVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char MLSLoggerVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger.modulemap: -------------------------------------------------------------------------------- 1 | framework module MLSLogger { 2 | umbrella header "MLSLogger-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/MLSLogger/MLSLogger.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MLSLogger 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CocoaLumberjack 5 | 6 | BSD 3-Clause License 7 | 8 | Copyright (c) 2010-2019, Deusty, LLC 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 12 | 13 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 14 | 15 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of Deusty nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Deusty, LLC. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 20 | 21 | 22 | ## MLSLogger 23 | 24 | MIT License 25 | 26 | Copyright (c) 2019 Minlison 27 | 28 | Permission is hereby granted, free of charge, to any person obtaining a copy 29 | of this software and associated documentation files (the "Software"), to deal 30 | in the Software without restriction, including without limitation the rights 31 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 32 | copies of the Software, and to permit persons to whom the Software is 33 | furnished to do so, subject to the following conditions: 34 | 35 | The above copyright notice and this permission notice shall be included in all 36 | copies or substantial portions of the Software. 37 | 38 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 39 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 40 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 41 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 42 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 43 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 44 | SOFTWARE. 45 | 46 | Generated by CocoaPods - https://cocoapods.org 47 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | BSD 3-Clause License 18 | 19 | Copyright (c) 2010-2019, Deusty, LLC 20 | All rights reserved. 21 | 22 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 23 | 24 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 25 | 26 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 27 | 28 | 3. Neither the name of Deusty nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of Deusty, LLC. 29 | 30 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | License 33 | BSD 34 | Title 35 | CocoaLumberjack 36 | Type 37 | PSGroupSpecifier 38 | 39 | 40 | FooterText 41 | MIT License 42 | 43 | Copyright (c) 2019 Minlison 44 | 45 | Permission is hereby granted, free of charge, to any person obtaining a copy 46 | of this software and associated documentation files (the "Software"), to deal 47 | in the Software without restriction, including without limitation the rights 48 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 49 | copies of the Software, and to permit persons to whom the Software is 50 | furnished to do so, subject to the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be included in all 53 | copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 61 | SOFTWARE. 62 | 63 | License 64 | MIT 65 | Title 66 | MLSLogger 67 | Type 68 | PSGroupSpecifier 69 | 70 | 71 | FooterText 72 | Generated by CocoaPods - https://cocoapods.org 73 | Title 74 | 75 | Type 76 | PSGroupSpecifier 77 | 78 | 79 | StringsTable 80 | Acknowledgements 81 | Title 82 | Acknowledgements 83 | 84 | 85 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MLSLoggerDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MLSLoggerDemo 5 | @end 6 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_MLSLoggerDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MLSLoggerDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/MLSLogger" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack/CocoaLumberjack.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MLSLogger/MLSLogger.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "CocoaLumberjack" -framework "MLSLogger" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MLSLoggerDemo { 2 | umbrella header "Pods-MLSLoggerDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /MLSLoggerDemo/Pods/Target Support Files/Pods-MLSLoggerDemo/Pods-MLSLoggerDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack" "${PODS_CONFIGURATION_BUILD_DIR}/MLSLogger" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CocoaLumberjack/CocoaLumberjack.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/MLSLogger/MLSLogger.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "CocoaLumberjack" -framework "MLSLogger" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MLSLogger 2 | 日志记录系统 3 | -------------------------------------------------------------------------------- /docs/html/Blocks/MLSLogBlock.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLogBlock Block Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 57 | 58 |
59 |
60 |
61 |
62 |

MLSLogBlock Block Reference

63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 |
Declared inMLSLogger.h
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
79 | 80 |
81 | 89 |
90 |
91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /docs/html/Classes/MLSLogger.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLogger Class Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 87 | 88 |
89 |
90 |
91 |
92 |

MLSLogger Class Reference

93 | 94 | 95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
Inherits fromNSObject
Declared inMLSLogger.h
104 | 105 | 106 | 107 | 108 |
109 | 110 |

Overview

111 |

showLevelenv 冲突, 以最后一个设置为准

112 |
113 | 114 | 115 | 116 | 117 | 118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 |
126 |
127 | 128 |

  showLevel 129 |

130 | 131 |
132 |
133 | 134 |
135 | 136 | 137 |
138 |

日志显示级别 Default MLSLoggerShowLevelOff

139 |
140 | 141 | 142 | 143 |
@property (nonatomic, assign, class) MLSLoggerShowLevel showLevel
144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 |
160 |

Declared In

161 |

MLSLogger.h

162 |
163 | 164 | 165 |
166 |
167 |
168 | 169 |

  env 170 |

171 | 172 |
173 |
174 | 175 |
176 | 177 | 178 |
179 |

日志模式 Default MLSLoggerEnvDebug 180 | 非发布模式,日志记录在 Document 下,可以 copy 出来 181 | 发布模式下,日志记录在 Library 下,不可以 copy 出来

182 |
183 | 184 | 185 | 186 |
@property (nonatomic, assign, class) MLSLoggerEnv env
187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 |
203 |

Declared In

204 |

MLSLogger.h

205 |
206 | 207 | 208 |
209 |
210 |
211 | 212 |

  verbose 213 |

214 | 215 |
216 |
217 | 218 |
219 | 220 | 221 |
222 |

verbose 日志级别

223 |
224 | 225 | 226 | 227 |
@property (copy, nonatomic, class, readonly) MLSLogBlock verbose
228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 |
244 |

Declared In

245 |

MLSLogger.h

246 |
247 | 248 | 249 |
250 |
251 |
252 | 253 |

  info 254 |

255 | 256 |
257 |
258 | 259 |
260 | 261 | 262 |
263 |

info 日志级别

264 |
265 | 266 | 267 | 268 |
@property (copy, nonatomic, class, readonly) MLSLogBlock info
269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 |
285 |

Declared In

286 |

MLSLogger.h

287 |
288 | 289 | 290 |
291 |
292 |
293 | 294 |

  debug 295 |

296 | 297 |
298 |
299 | 300 |
301 | 302 | 303 |
304 |

debug 日志级别

305 |
306 | 307 | 308 | 309 |
@property (copy, nonatomic, class, readonly) MLSLogBlock debug
310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 |
326 |

Declared In

327 |

MLSLogger.h

328 |
329 | 330 | 331 |
332 |
333 |
334 | 335 |

  warning 336 |

337 | 338 |
339 |
340 | 341 |
342 | 343 | 344 |
345 |

warning 日志级别

346 |
347 | 348 | 349 | 350 |
@property (copy, nonatomic, class, readonly) MLSLogBlock warning
351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 |
367 |

Declared In

368 |

MLSLogger.h

369 |
370 | 371 | 372 |
373 |
374 |
375 | 376 |

  error 377 |

378 | 379 |
380 |
381 | 382 |
383 | 384 | 385 |
386 |

error 日志级别

387 |
388 | 389 | 390 | 391 |
@property (copy, nonatomic, class, readonly) MLSLogBlock error
392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 |
408 |

Declared In

409 |

MLSLogger.h

410 |
411 | 412 | 413 |
414 |
415 |
416 |
417 | 418 |
419 | 420 | 421 | 422 | 423 |
424 | 425 |
426 | 434 |
435 |
436 |
437 |
438 | 439 | 440 | 441 | -------------------------------------------------------------------------------- /docs/html/Constants/MLSLoggerEnv.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLoggerEnv Constants Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 57 | 58 |
59 |
60 |
61 |
62 |

MLSLoggerEnv Constants Reference

63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 |
Declared inMLSLogger.h
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |

MLSLoggerEnv

79 | 80 | 81 |
82 |

日志模式

83 | 84 |
    85 |
  • MLSLoggerEnvDebug: 调试模式, 对应日志级别 MLSLoggerShowLevelVerbose
  • 86 |
  • MLSLoggerEnvTest: 测试模式 对应日志级别 MLSLoggerShowLevelInfo
  • 87 |
  • MLSLoggerEnvPreRelease: 预发布模式 对应日志级别 MLSLoggerShowLevelWarning
  • 88 |
  • MLSLoggerEnvGrayScaleRelease: 灰度发布 对应日志级别 MLSLoggerShowLevelError
  • 89 |
  • MLSLoggerEnvRelease: 发布 对应日志级别 MLSLoggerShowLevelError
  • 90 |
91 | 92 |
93 | 94 | 95 |
96 | 97 | 98 |

Definition

99 | typedef NS_ENUM(NSInteger, MLSLoggerEnv ) {
100 | 101 |    MLSLoggerEnvDebug,
102 | 103 |    MLSLoggerEnvTest,
104 | 105 |    MLSLoggerEnvPreRelease,
106 | 107 |    MLSLoggerEnvGrayScaleRelease,
108 | 109 |    MLSLoggerEnvRelease,
110 | 111 | };
112 | 113 |
114 | 115 |
116 |

Constants

117 |
118 | 119 |
MLSLoggerEnvDebug
120 |
121 | 122 | 123 |

日志模式

124 | 125 | 126 | 127 | 128 | 129 | 130 |

131 | Declared In MLSLogger.h. 132 |

133 | 134 |
135 | 136 |
MLSLoggerEnvTest
137 |
138 | 139 | 140 |

日志模式

141 | 142 | 143 | 144 | 145 | 146 | 147 |

148 | Declared In MLSLogger.h. 149 |

150 | 151 |
152 | 153 |
MLSLoggerEnvPreRelease
154 |
155 | 156 | 157 |

日志模式

158 | 159 | 160 | 161 | 162 | 163 | 164 |

165 | Declared In MLSLogger.h. 166 |

167 | 168 |
169 | 170 |
MLSLoggerEnvGrayScaleRelease
171 |
172 | 173 | 174 |

日志模式

175 | 176 | 177 | 178 | 179 | 180 | 181 |

182 | Declared In MLSLogger.h. 183 |

184 | 185 |
186 | 187 |
MLSLoggerEnvRelease
188 |
189 | 190 | 191 |

日志模式

192 | 193 | 194 | 195 | 196 | 197 | 198 |

199 | Declared In MLSLogger.h. 200 |

201 | 202 |
203 | 204 |
205 |
206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 |
215 |

Declared In

216 |

MLSLogger.h

217 |
218 | 219 | 220 | 221 |
222 | 223 |
224 | 232 |
233 |
234 |
235 |
236 | 237 | 238 | 239 | -------------------------------------------------------------------------------- /docs/html/Constants/MLSLoggerShowLevel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLoggerShowLevel Constants Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 57 | 58 |
59 |
60 |
61 |
62 |

MLSLoggerShowLevel Constants Reference

63 | 64 | 65 |
66 | 67 | 68 | 69 | 70 |
Declared inMLSLogger.h
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |

MLSLoggerShowLevel

79 | 80 | 81 |
82 |

日志显示级别

83 | 84 |
    85 |
  • MLSLoggerShowLevelVerbose: 全部 默认
  • 86 |
  • MLSLoggerShowLevelInfo: 信息
  • 87 |
  • MLSLoggerShowLevelDebug: 调试
  • 88 |
  • MLSLoggerShowLevelWarning: 警告
  • 89 |
  • MLSLoggerShowLevelError: 错误
  • 90 |
91 | 92 |
93 | 94 | 95 |
96 | 97 | 98 |

Definition

99 | typedef NS_ENUM(NSInteger, MLSLoggerShowLevel ) {
100 | 101 |    MLSLoggerShowLevelAll,
102 | 103 |    MLSLoggerShowLevelVerbose,
104 | 105 |    MLSLoggerShowLevelDebug,
106 | 107 |    MLSLoggerShowLevelInfo,
108 | 109 |    MLSLoggerShowLevelWarning,
110 | 111 |    MLSLoggerShowLevelError,
112 | 113 |    MLSLoggerShowLevelOff,
114 | 115 | };
116 | 117 |
118 | 119 |
120 |

Constants

121 |
122 | 123 |
MLSLoggerShowLevelAll
124 |
125 | 126 | 127 |

日志显示级别

128 | 129 | 130 | 131 | 132 | 133 | 134 |

135 | Declared In MLSLogger.h. 136 |

137 | 138 |
139 | 140 |
MLSLoggerShowLevelVerbose
141 |
142 | 143 | 144 |

日志显示级别

145 | 146 | 147 | 148 | 149 | 150 | 151 |

152 | Declared In MLSLogger.h. 153 |

154 | 155 |
156 | 157 |
MLSLoggerShowLevelDebug
158 |
159 | 160 | 161 |

日志显示级别

162 | 163 | 164 | 165 | 166 | 167 | 168 |

169 | Declared In MLSLogger.h. 170 |

171 | 172 |
173 | 174 |
MLSLoggerShowLevelInfo
175 |
176 | 177 | 178 |

日志显示级别

179 | 180 | 181 | 182 | 183 | 184 | 185 |

186 | Declared In MLSLogger.h. 187 |

188 | 189 |
190 | 191 |
MLSLoggerShowLevelWarning
192 |
193 | 194 | 195 |

日志显示级别

196 | 197 | 198 | 199 | 200 | 201 | 202 |

203 | Declared In MLSLogger.h. 204 |

205 | 206 |
207 | 208 |
MLSLoggerShowLevelError
209 |
210 | 211 | 212 |

日志显示级别

213 | 214 | 215 | 216 | 217 | 218 | 219 |

220 | Declared In MLSLogger.h. 221 |

222 | 223 |
224 | 225 |
MLSLoggerShowLevelOff
226 |
227 | 228 | 229 |

日志显示级别

230 | 231 | 232 | 233 | 234 | 235 | 236 |

237 | Declared In MLSLogger.h. 238 |

239 | 240 |
241 | 242 |
243 |
244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 |
253 |

Declared In

254 |

MLSLogger.h

255 |
256 | 257 | 258 | 259 |
260 | 261 |
262 | 270 |
271 |
272 |
273 |
274 | 275 | 276 | 277 | -------------------------------------------------------------------------------- /docs/html/css/scss/_index.scss: -------------------------------------------------------------------------------- 1 | .index-container { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | 6 | @media (max-width: $mobile-max-width) { 7 | flex-direction: column; 8 | } 9 | 10 | .index-column { 11 | flex: 1 1 33%; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/html/css/scss/_layout.scss: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | .clear { 6 | clear: both; 7 | } 8 | 9 | .clearfix { 10 | &:before, &:after { 11 | clear: both; 12 | display: table; 13 | content: ""; 14 | } 15 | } 16 | 17 | .xcode .hide-in-xcode { 18 | display: none; 19 | } 20 | 21 | body { 22 | font: 62.5% $body-font; 23 | background: $body-background; 24 | } 25 | 26 | h1, h2, h3 { 27 | font-weight: 300; 28 | color: #808080; 29 | } 30 | 31 | h1 { 32 | font-size: 2em; 33 | color: #000; 34 | } 35 | 36 | h4 { 37 | font-size: 13px; 38 | line-height: 1.5; 39 | margin: 21px 0 0 0; 40 | } 41 | 42 | a { 43 | color: $tint-color; 44 | text-decoration: none; 45 | } 46 | 47 | pre, code { 48 | font-family: $code-font; 49 | word-wrap: break-word; 50 | } 51 | 52 | pre > code, .method-declaration code { 53 | display: inline-block; 54 | font-size: .85em; 55 | padding: 4px 0 4px 10px; 56 | border-left: 5px solid rgba(0, 155, 51, .2); 57 | 58 | &:before { 59 | content: "Objective-C"; 60 | display: block; 61 | 62 | font: 9px/1 $body-font; 63 | color: #009b33; 64 | text-transform: uppercase; 65 | letter-spacing: 2px; 66 | padding-bottom: 6px; 67 | } 68 | } 69 | 70 | pre > code { 71 | font-size: inherit; 72 | } 73 | 74 | table, th, td { 75 | border: 1px solid #e9e9e9; 76 | } 77 | 78 | table { 79 | width: 100%; 80 | } 81 | 82 | th, td { 83 | padding: 7px; 84 | 85 | > :first-child { 86 | margin-top: 0; 87 | } 88 | 89 | > :last-child { 90 | margin-bottom: 0; 91 | } 92 | } 93 | 94 | .container { 95 | @extend .clearfix; 96 | 97 | max-width: 980px; 98 | padding: 0 10px; 99 | margin: 0 auto; 100 | 101 | @media (max-width: $mobile-max-width) { 102 | padding: 0; 103 | } 104 | } 105 | 106 | header { 107 | position: fixed; 108 | top: 0; 109 | left: 0; 110 | width: 100%; 111 | z-index: 2; 112 | 113 | background: #414141; 114 | color: #fff; 115 | font-size: 1.1em; 116 | line-height: 25px; 117 | letter-spacing: .05em; 118 | 119 | #library-title { 120 | float: left; 121 | } 122 | 123 | #developer-home { 124 | float: right; 125 | } 126 | 127 | h1 { 128 | font-size: inherit; 129 | font-weight: inherit; 130 | margin: 0; 131 | } 132 | 133 | p { 134 | margin: 0; 135 | } 136 | 137 | h1, a { 138 | color: inherit; 139 | } 140 | 141 | @media (max-width: $mobile-max-width) { 142 | position: absolute; 143 | 144 | .container { 145 | padding: 0 10px; 146 | } 147 | } 148 | } 149 | 150 | aside { 151 | position: fixed; 152 | top: 25px; 153 | left: 0; 154 | width: 100%; 155 | height: 25px; 156 | z-index: 2; 157 | 158 | font-size: 1.1em; 159 | 160 | @media (max-width: $mobile-max-width) { 161 | position: absolute; 162 | } 163 | 164 | #header-buttons { 165 | background: rgba(255, 255, 255, .8); 166 | margin: 0 1px; 167 | padding: 0; 168 | list-style: none; 169 | text-align: right; 170 | line-height: 32px; 171 | 172 | li { 173 | display: inline-block; 174 | cursor: pointer; 175 | padding: 0 10px; 176 | } 177 | 178 | label, select { 179 | cursor: inherit; 180 | } 181 | 182 | #on-this-page { 183 | position: relative; 184 | 185 | .chevron { 186 | display: inline-block; 187 | width: 14px; 188 | height: 4px; 189 | position: relative; 190 | 191 | .chevy { 192 | background: #878787; 193 | height: 2px; 194 | position: absolute; 195 | width: 10px; 196 | 197 | &.chevron-left { 198 | left: 0; 199 | transform: rotateZ(45deg) scale(0.6); 200 | } 201 | 202 | &.chevron-right { 203 | right: 0; 204 | transform: rotateZ(-45deg) scale(0.6); 205 | } 206 | } 207 | } 208 | 209 | #jump-to { 210 | opacity: 0; 211 | font-size: 16px; 212 | 213 | position: absolute; 214 | top: 5px; 215 | left: 0; 216 | width: 100%; 217 | height: 100%; 218 | } 219 | } 220 | } 221 | } 222 | 223 | article { 224 | margin-top: 25px; 225 | 226 | #content { 227 | @extend .clearfix; 228 | 229 | background: $content-background; 230 | border: 1px solid $content-border; 231 | padding: 15px 25px 30px 25px; 232 | 233 | font-size: 1.4em; 234 | line-height: 1.45; 235 | 236 | position: relative; 237 | 238 | @media (max-width: $mobile-max-width) { 239 | padding: 15px 10px 20px 10px; 240 | } 241 | 242 | .navigation-top { 243 | position: absolute; 244 | top: 15px; 245 | right: 25px; 246 | } 247 | 248 | .title { 249 | margin: 21px 0 0 0; 250 | padding: 15px 0; 251 | } 252 | 253 | p { 254 | color: #414141; 255 | margin: 0 0 15px 0; 256 | } 257 | 258 | th, td { 259 | p:last-child { 260 | margin-bottom: 0; 261 | } 262 | } 263 | 264 | main { 265 | ul { 266 | list-style: none; 267 | margin-left: 24px; 268 | margin-bottom: 12px; 269 | padding: 0; 270 | 271 | li { 272 | position: relative; 273 | padding-left: 1.3em; 274 | 275 | &:before { 276 | content: "\02022"; 277 | 278 | color: #414141; 279 | font-size: 1.08em; 280 | line-height: 1; 281 | 282 | position: absolute; 283 | left: 0; 284 | padding-top: 2px; 285 | } 286 | } 287 | } 288 | } 289 | 290 | footer { 291 | @extend .clearfix; 292 | 293 | .footer-copyright { 294 | margin: 70px 25px 10px 0; 295 | } 296 | 297 | p { 298 | font-size: .71em; 299 | color: #a0a0a0; 300 | } 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /docs/html/css/scss/_object.scss: -------------------------------------------------------------------------------- 1 | .section-specification { 2 | table { 3 | width: auto; 4 | 5 | th { 6 | text-align: left; 7 | } 8 | } 9 | } 10 | 11 | .method-title { 12 | margin-left: -15px; 13 | margin-bottom: 8px; 14 | transition: margin-left .3s ease-out; 15 | 16 | .section-method.hide & { 17 | margin-left: 0; 18 | } 19 | 20 | code { 21 | font-weight: 400; 22 | font-size: .85em; 23 | } 24 | } 25 | 26 | .method-info { 27 | background: $object-background; 28 | border-bottom: 1px solid $object-border; 29 | margin: 0 -25px; 30 | padding: 20px 25px 0 25px; 31 | transition: height .3s ease-out; 32 | 33 | position: relative; 34 | 35 | .pointy-thing { 36 | background: $content-background; 37 | height: 10px; 38 | border-bottom: 1px solid $object-border; 39 | margin: -20px -25px 16px -25px; 40 | 41 | &:before { 42 | display: inline-block; 43 | content: ""; 44 | 45 | background: $object-background; 46 | border: 1px solid $object-border; 47 | border-bottom: 0; 48 | border-right: 0; 49 | 50 | position: absolute; 51 | left: 21px; 52 | top: 3px; 53 | width: 12px; 54 | height: 12px; 55 | transform: rotate(45deg); 56 | } 57 | } 58 | 59 | .method-subsection { 60 | margin-bottom: 15px; 61 | 62 | .argument-name { 63 | width: 1px; 64 | text-align: right; 65 | 66 | code { 67 | color: #808080; 68 | font-style: italic; 69 | font-weight: 400; 70 | } 71 | } 72 | } 73 | } 74 | 75 | .section-method { 76 | &.hide .method-info { 77 | height: 0 !important; 78 | overflow: hidden; 79 | display: none; 80 | } 81 | 82 | &.hide.animating .method-info { 83 | display: block; 84 | } 85 | 86 | &.animating .method-info { 87 | overflow: hidden; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /docs/html/css/scss/_print.scss: -------------------------------------------------------------------------------- 1 | @media print { 2 | body { 3 | background: #fff; 4 | padding: 8px; 5 | } 6 | 7 | header { 8 | position: static; 9 | background: #fff; 10 | color: #000; 11 | } 12 | 13 | aside { 14 | display: none; 15 | } 16 | 17 | .container { 18 | max-width: none; 19 | padding: 0; 20 | } 21 | 22 | article { 23 | margin-top: 0; 24 | 25 | #content { 26 | border: 0; 27 | background: #fff; 28 | padding: 15px 0 0 0; 29 | 30 | .title { 31 | margin-top: 0; 32 | padding-top: 0; 33 | } 34 | } 35 | } 36 | 37 | .method-info { 38 | &, & .pointy-thing { 39 | background: #fff; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /docs/html/css/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | $body-font: -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; 2 | $code-font: "Source Code Pro", Monaco, Menlo, Consolas, monospace; 3 | 4 | $body-background: #f2f2f2; 5 | $content-background: #fff; 6 | $content-border: #e9e9e9; 7 | $tint-color: #08c; 8 | $object-background: #f9f9f9; 9 | $object-border: #e9e9e9; 10 | 11 | $mobile-max-width: 650px; 12 | -------------------------------------------------------------------------------- /docs/html/css/scss/_xcode.scss: -------------------------------------------------------------------------------- 1 | .xcode { 2 | header, aside { 3 | display: none; 4 | } 5 | 6 | .container { 7 | padding: 0; 8 | } 9 | 10 | article { 11 | margin-top: 0; 12 | 13 | #content { 14 | border: 0; 15 | margin: 0; 16 | } 17 | } 18 | 19 | .method-info { 20 | &, .section-method.hide & { 21 | max-height: auto; 22 | overflow: visible; 23 | 24 | &.hiding { 25 | display: block; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/html/css/scss/style.scss: -------------------------------------------------------------------------------- 1 | @import "variables", "normalize", "layout", "index", "object", "print", "xcode"; 2 | -------------------------------------------------------------------------------- /docs/html/css/style.css: -------------------------------------------------------------------------------- 1 | html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{box-sizing:border-box}.clear{clear:both}.clearfix:before,.container:before,article #content:before,article #content footer:before,.clearfix:after,.container:after,article #content:after,article #content footer:after{clear:both;display:table;content:""}.xcode .hide-in-xcode{display:none}body{font:62.5% -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;background:#f2f2f2}h1,h2,h3{font-weight:300;color:gray}h1{font-size:2em;color:#000}h4{font-size:13px;line-height:1.5;margin:21px 0 0}a{color:#08c;text-decoration:none}pre,code{font-family:Source Code Pro,Monaco,Menlo,Consolas,monospace;word-wrap:break-word}pre>code,.method-declaration code{display:inline-block;font-size:.85em;padding:4px 0 4px 10px;border-left:5px solid rgba(0,155,51,.2)}pre>code:before,.method-declaration code:before{content:"Objective-C";display:block;font:9px/1 -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;color:#009b33;text-transform:uppercase;letter-spacing:2px;padding-bottom:6px}pre>code{font-size:inherit}table,th,td{border:1px solid #e9e9e9}table{width:100%}th,td{padding:7px}th>:first-child,td>:first-child{margin-top:0}th>:last-child,td>:last-child{margin-bottom:0}.container{max-width:980px;padding:0 10px;margin:0 auto}@media(max-width:650px){.container{padding:0}}header{position:fixed;top:0;left:0;width:100%;z-index:2;background:#414141;color:#fff;font-size:1.1em;line-height:25px;letter-spacing:.05em}header #library-title{float:left}header #developer-home{float:right}header h1{font-size:inherit;font-weight:inherit;margin:0}header p{margin:0}header h1,header a{color:inherit}@media(max-width:650px){header{position:absolute}header .container{padding:0 10px}}aside{position:fixed;top:25px;left:0;width:100%;height:25px;z-index:2;font-size:1.1em}aside #header-buttons{background:rgba(255,255,255,.8);margin:0 1px;padding:0;list-style:none;text-align:right;line-height:32px}aside #header-buttons li{display:inline-block;cursor:pointer;padding:0 10px}aside #header-buttons label,aside #header-buttons select{cursor:inherit}aside #header-buttons #on-this-page{position:relative}aside #header-buttons #on-this-page .chevron{display:inline-block;width:14px;height:4px;position:relative}aside #header-buttons #on-this-page .chevron .chevy{background:#878787;height:2px;position:absolute;width:10px}aside #header-buttons #on-this-page .chevron .chevy.chevron-left{left:0;-webkit-transform:rotateZ(45deg) scale(.6);transform:rotateZ(45deg) scale(.6)}aside #header-buttons #on-this-page .chevron .chevy.chevron-right{right:0;-webkit-transform:rotateZ(-45deg) scale(.6);transform:rotateZ(-45deg) scale(.6)}aside #header-buttons #on-this-page #jump-to{opacity:0;filter:alpha(opacity=0);font-size:16px;position:absolute;top:5px;left:0;width:100%;height:100%}article{margin-top:25px}article #content{background:#fff;border:1px solid #e9e9e9;padding:15px 25px 30px;font-size:1.4em;line-height:1.45;position:relative}@media(max-width:650px){article #content{padding:15px 10px 20px}}article #content .navigation-top{position:absolute;top:15px;right:25px}article #content .title{margin:21px 0 0;padding:15px 0}article #content p{color:#414141;margin:0 0 15px}article #content th p:last-child,article #content td p:last-child{margin-bottom:0}article #content main ul{list-style:none;margin-left:24px;margin-bottom:12px;padding:0}article #content main ul li{position:relative;padding-left:1.3em}article #content main ul li:before{content:"\02022";color:#414141;font-size:1.08em;line-height:1;position:absolute;left:0;padding-top:2px}article #content footer .footer-copyright{margin:70px 25px 10px 0}article #content footer p{font-size:.71em;color:#a0a0a0}.index-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}@media(max-width:650px){.index-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}}.index-container .index-column{-webkit-box-flex:1;-webkit-flex:1 1 33%;-ms-flex:1 1 33%;flex:1 1 33%}.section-specification table{width:auto}.section-specification table th{text-align:left}.method-title{margin-left:-15px;margin-bottom:8px;-webkit-transition:margin-left .3s ease-out;transition:margin-left .3s ease-out}.section-method.hide .method-title{margin-left:0}.method-title code{font-weight:400;font-size:.85em}.method-info{background:#f9f9f9;border-bottom:1px solid #e9e9e9;margin:0 -25px;padding:20px 25px 0;-webkit-transition:height .3s ease-out;transition:height .3s ease-out;position:relative}.method-info .pointy-thing{background:#fff;height:10px;border-bottom:1px solid #e9e9e9;margin:-20px -25px 16px}.method-info .pointy-thing:before{display:inline-block;content:"";background:#f9f9f9;border:1px solid #e9e9e9;border-bottom:0;border-right:0;position:absolute;left:21px;top:3px;width:12px;height:12px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.method-info .method-subsection{margin-bottom:15px}.method-info .method-subsection .argument-name{width:1px;text-align:right}.method-info .method-subsection .argument-name code{color:gray;font-style:italic;font-weight:400}.section-method.hide .method-info{height:0!important;overflow:hidden;display:none}.section-method.hide.animating .method-info{display:block}.section-method.animating .method-info{overflow:hidden}@media print{body{background:#fff;padding:8px}header{position:static;background:#fff;color:#000}aside{display:none}.container{max-width:none;padding:0}article{margin-top:0}article #content{border:0;background:#fff;padding:15px 0 0}article #content .title{margin-top:0;padding-top:0}.method-info,.method-info .pointy-thing{background:#fff}}.xcode header,.xcode aside{display:none}.xcode .container{padding:0}.xcode article{margin-top:0}.xcode article #content{border:0;margin:0}.xcode .section-method.hide .method-info,.xcode .section-method.hide.animating .method-info,.xcode .section-method.animating .method-info{height:auto!important;overflow:visible;display:block}.xcode .section-method.hide .method-title{margin-left:-15px} 2 | /*# sourceMappingURL=to.css.map */ -------------------------------------------------------------------------------- /docs/html/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLogger Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 36 | 37 |
38 |
39 |
40 |
41 |

MLSLogger Hierarchy

42 | 43 | 44 |
45 |

Class Hierarchy

46 | 47 |
    48 | 49 |
  • NSObject 50 | 55 |
  • 56 | 57 |
58 | 59 |
60 | 61 | 62 | 63 |
64 | 65 | 66 |

Constant References

67 | 74 | 75 | 76 |
77 | 78 | 79 |
80 | 88 |
89 |
90 |
91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /docs/html/img/button_bar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSLogger/466828a392f83a0fea5dfb751aa2de58815344fd/docs/html/img/button_bar_background.png -------------------------------------------------------------------------------- /docs/html/img/disclosure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSLogger/466828a392f83a0fea5dfb751aa2de58815344fd/docs/html/img/disclosure.png -------------------------------------------------------------------------------- /docs/html/img/disclosure_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSLogger/466828a392f83a0fea5dfb751aa2de58815344fd/docs/html/img/disclosure_open.png -------------------------------------------------------------------------------- /docs/html/img/library_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSLogger/466828a392f83a0fea5dfb751aa2de58815344fd/docs/html/img/library_background.png -------------------------------------------------------------------------------- /docs/html/img/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Minlison/MLSLogger/466828a392f83a0fea5dfb751aa2de58815344fd/docs/html/img/title_background.png -------------------------------------------------------------------------------- /docs/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MLSLogger Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 |

17 | MLSLogger 18 |

19 | 20 |

21 | MinLison 22 |

23 | 24 |
25 |
26 | 27 | 36 | 37 |
38 |
39 |
40 |
41 |

MLSLogger Reference

42 | 43 | 44 | 45 |
46 | 47 | 48 | 49 |
50 |

Class References

51 | 56 |
57 | 58 | 59 | 60 |
61 | 62 | 63 | 64 |

Constant References

65 | 72 | 73 | 74 | 75 |
76 | 77 |
78 | 79 |
80 | 88 |
89 |
90 |
91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /docs/html/js/script.js: -------------------------------------------------------------------------------- 1 | function $() { 2 | return document.querySelector.apply(document, arguments); 3 | } 4 | 5 | if (navigator.userAgent.indexOf("Xcode") != -1) { 6 | document.documentElement.classList.add("xcode"); 7 | } 8 | 9 | var jumpTo = $("#jump-to"); 10 | 11 | if (jumpTo) { 12 | jumpTo.addEventListener("change", function(e) { 13 | location.hash = this.options[this.selectedIndex].value; 14 | }); 15 | } 16 | 17 | function hashChanged() { 18 | if (/^#\/\/api\//.test(location.hash)) { 19 | var element = document.querySelector("a[name='" + location.hash.substring(1) + "']"); 20 | 21 | if (!element) { 22 | return; 23 | } 24 | 25 | element = element.parentNode; 26 | 27 | element.classList.remove("hide"); 28 | fixScrollPosition(element); 29 | } 30 | } 31 | 32 | function fixScrollPosition(element) { 33 | var scrollTop = element.offsetTop - 150; 34 | document.documentElement.scrollTop = scrollTop; 35 | document.body.scrollTop = scrollTop; 36 | } 37 | 38 | [].forEach.call(document.querySelectorAll(".section-method"), function(element) { 39 | element.classList.add("hide"); 40 | 41 | element.querySelector(".method-title a").addEventListener("click", function(e) { 42 | var info = element.querySelector(".method-info"), 43 | infoContainer = element.querySelector(".method-info-container"); 44 | 45 | element.classList.add("animating"); 46 | info.style.height = (infoContainer.clientHeight + 40) + "px"; 47 | fixScrollPosition(element); 48 | element.classList.toggle("hide"); 49 | 50 | setTimeout(function() { 51 | element.classList.remove("animating"); 52 | info.style.height = "auto"; 53 | }, 300); 54 | }); 55 | }); 56 | 57 | window.addEventListener("hashchange", hashChanged); 58 | hashChanged(); 59 | -------------------------------------------------------------------------------- /docs/markdown/Blocks/MLSLogBlock.md: -------------------------------------------------------------------------------- 1 | # MLSLogBlock Block Reference 2 | 3 |   **Declared in** MLSLogger.h 4 | 5 | 6 | ## Block Definition 7 | ### MLSLogBlock 8 | 9 | 日志函数输出函数 10 | 11 | typedef void (^MLSLogBlock) (NSString *format, ... ) 12 | 13 | #### Declared In 14 | MLSLogger.h 15 | 16 | -------------------------------------------------------------------------------- /docs/markdown/Classes/MLSLogger.md: -------------------------------------------------------------------------------- 1 | # MLSLogger Class Reference 2 | 3 |   **Inherits from** NSObject 4 |   **Declared in** MLSLogger.h 5 | 6 | ## Overview 7 | 8 | showLevelenv 冲突, 以最后一个设置为准 9 | 10 | ## Tasks 11 | 12 | ### 13 | 14 | [  showLevel](#//api/name/showLevel) *property* 15 | 16 | [  env](#//api/name/env) *property* 17 | 18 | [  verbose](#//api/name/verbose) *property* 19 | 20 | [  info](#//api/name/info) *property* 21 | 22 | [  debug](#//api/name/debug) *property* 23 | 24 | [  warning](#//api/name/warning) *property* 25 | 26 | [  error](#//api/name/error) *property* 27 | 28 | ## Properties 29 | 30 | 31 | ### debug 32 | 33 | debug 日志级别 34 | 35 | `@property (copy, nonatomic, class, readonly) MLSLogBlock debug` 36 | 37 | #### Declared In 38 | * `MLSLogger.h` 39 | 40 | 41 | ### env 42 | 43 | 日志模式 Default MLSLoggerEnvDebug 44 | 非发布模式,日志记录在 Document 下,可以 copy 出来 45 | 发布模式下,日志记录在 Library 下,不可以 copy 出来 46 | 47 | `@property (nonatomic, assign, class) MLSLoggerEnv env` 48 | 49 | #### Declared In 50 | * `MLSLogger.h` 51 | 52 | 53 | ### error 54 | 55 | error 日志级别 56 | 57 | `@property (copy, nonatomic, class, readonly) MLSLogBlock error` 58 | 59 | #### Declared In 60 | * `MLSLogger.h` 61 | 62 | 63 | ### info 64 | 65 | info 日志级别 66 | 67 | `@property (copy, nonatomic, class, readonly) MLSLogBlock info` 68 | 69 | #### Declared In 70 | * `MLSLogger.h` 71 | 72 | 73 | ### showLevel 74 | 75 | 日志显示级别 Default MLSLoggerShowLevelOff 76 | 77 | `@property (nonatomic, assign, class) MLSLoggerShowLevel showLevel` 78 | 79 | #### Declared In 80 | * `MLSLogger.h` 81 | 82 | 83 | ### verbose 84 | 85 | verbose 日志级别 86 | 87 | `@property (copy, nonatomic, class, readonly) MLSLogBlock verbose` 88 | 89 | #### Declared In 90 | * `MLSLogger.h` 91 | 92 | 93 | ### warning 94 | 95 | warning 日志级别 96 | 97 | `@property (copy, nonatomic, class, readonly) MLSLogBlock warning` 98 | 99 | #### Declared In 100 | * `MLSLogger.h` 101 | 102 | -------------------------------------------------------------------------------- /docs/markdown/Constants/MLSLoggerEnv.md: -------------------------------------------------------------------------------- 1 | # MLSLoggerEnv Constants Reference 2 | 3 |   **Declared in** MLSLogger.h 4 | 5 | ### MLSLoggerEnv 6 | 7 | 日志模式 8 | 9 |
    10 |
  • MLSLoggerEnvDebug: 调试模式, 对应日志级别 MLSLoggerShowLevelVerbose
  • 11 |
  • MLSLoggerEnvTest: 测试模式 对应日志级别 MLSLoggerShowLevelInfo
  • 12 |
  • MLSLoggerEnvPreRelease: 预发布模式 对应日志级别 MLSLoggerShowLevelWarning
  • 13 |
  • MLSLoggerEnvGrayScaleRelease: 灰度发布 对应日志级别 MLSLoggerShowLevelError
  • 14 |
  • MLSLoggerEnvRelease: 发布 对应日志级别 MLSLoggerShowLevelError
  • 15 |
16 | 17 | #### Definition 18 | typedef NS_ENUM(NSInteger, MLSLoggerEnv ) { 19 | 20 | MLSLoggerEnvDebug, 21 | 22 | MLSLoggerEnvTest, 23 | 24 | MLSLoggerEnvPreRelease, 25 | 26 | MLSLoggerEnvGrayScaleRelease, 27 | 28 | MLSLoggerEnvRelease, 29 | 30 | }; 31 | 32 | #### Constants 33 | 34 | MLSLoggerEnvDebug 35 | 36 | 日志模式 37 | 38 |    Declared In `MLSLogger.h`. 39 | 40 | MLSLoggerEnvTest 41 | 42 | 日志模式 43 | 44 |    Declared In `MLSLogger.h`. 45 | 46 | MLSLoggerEnvPreRelease 47 | 48 | 日志模式 49 | 50 |    Declared In `MLSLogger.h`. 51 | 52 | MLSLoggerEnvGrayScaleRelease 53 | 54 | 日志模式 55 | 56 |    Declared In `MLSLogger.h`. 57 | 58 | MLSLoggerEnvRelease 59 | 60 | 日志模式 61 | 62 |    Declared In `MLSLogger.h`. 63 | 64 | #### Declared In 65 | `MLSLogger.h` 66 | 67 | -------------------------------------------------------------------------------- /docs/markdown/Constants/MLSLoggerShowLevel.md: -------------------------------------------------------------------------------- 1 | # MLSLoggerShowLevel Constants Reference 2 | 3 |   **Declared in** MLSLogger.h 4 | 5 | ### MLSLoggerShowLevel 6 | 7 | 日志显示级别 8 | 9 |
    10 |
  • MLSLoggerShowLevelVerbose: 全部 默认
  • 11 |
  • MLSLoggerShowLevelInfo: 信息
  • 12 |
  • MLSLoggerShowLevelDebug: 调试
  • 13 |
  • MLSLoggerShowLevelWarning: 警告
  • 14 |
  • MLSLoggerShowLevelError: 错误
  • 15 |
16 | 17 | #### Definition 18 | typedef NS_ENUM(NSInteger, MLSLoggerShowLevel ) { 19 | 20 | MLSLoggerShowLevelAll, 21 | 22 | MLSLoggerShowLevelVerbose, 23 | 24 | MLSLoggerShowLevelDebug, 25 | 26 | MLSLoggerShowLevelInfo, 27 | 28 | MLSLoggerShowLevelWarning, 29 | 30 | MLSLoggerShowLevelError, 31 | 32 | MLSLoggerShowLevelOff, 33 | 34 | }; 35 | 36 | #### Constants 37 | 38 | MLSLoggerShowLevelAll 39 | 40 | 日志显示级别 41 | 42 |    Declared In `MLSLogger.h`. 43 | 44 | MLSLoggerShowLevelVerbose 45 | 46 | 日志显示级别 47 | 48 |    Declared In `MLSLogger.h`. 49 | 50 | MLSLoggerShowLevelDebug 51 | 52 | 日志显示级别 53 | 54 |    Declared In `MLSLogger.h`. 55 | 56 | MLSLoggerShowLevelInfo 57 | 58 | 日志显示级别 59 | 60 |    Declared In `MLSLogger.h`. 61 | 62 | MLSLoggerShowLevelWarning 63 | 64 | 日志显示级别 65 | 66 |    Declared In `MLSLogger.h`. 67 | 68 | MLSLoggerShowLevelError 69 | 70 | 日志显示级别 71 | 72 |    Declared In `MLSLogger.h`. 73 | 74 | MLSLoggerShowLevelOff 75 | 76 | 日志显示级别 77 | 78 |    Declared In `MLSLogger.h`. 79 | 80 | #### Declared In 81 | `MLSLogger.h` 82 | 83 | -------------------------------------------------------------------------------- /push_repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | pod repo update minlison 3 | echo "-------发布 $1 到 minlison 库...-------" 4 | pod repo push minlison MLSLogger.podspec --sources=https://github.com/Minlison/Specs.git,master 5 | echo "-------发布 $1 到 minlison 库完成-------" 6 | pod repo update minlison 7 | --------------------------------------------------------------------------------