├── .gitignore ├── Icons ├── NOPE autoplay-2x_128.png ├── NOPE autoplay-2x_16.png ├── NOPE autoplay-2x_256.png ├── NOPE autoplay-2x_32.png ├── NOPE autoplay-2x_512.png ├── NOPE autoplay-2x_64.png ├── NOPE autoplay_128.png ├── NOPE autoplay_16.png ├── NOPE autoplay_256.png ├── NOPE autoplay_32.png ├── NOPE autoplay_512.png └── NOPE autoplay_64.png ├── Images └── Screenshot-1.0.png ├── LICENSE.txt ├── Play Button iTunes Patch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── Play Button iTunes Patch.xccheckout │ └── xcuserdata │ │ └── thebitguru.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ └── Play Button iTunes Patch.xcscheme ├── Play Button iTunes Patch.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── Play Button iTunes Patch.xccheckout ├── Podfile ├── Podfile.lock ├── Pods ├── CocoaLumberjack │ ├── Classes │ │ ├── CocoaLumberjack.h │ │ ├── CocoaLumberjack.swift │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogCapture.m │ │ ├── DDASLLogger.h │ │ ├── DDASLLogger.m │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAbstractDatabaseLogger.m │ │ ├── DDAssertMacros.h │ │ ├── DDFileLogger.h │ │ ├── DDFileLogger.m │ │ ├── DDLegacy.h │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLog.m │ │ ├── DDLogMacros.h │ │ ├── DDTTYLogger.h │ │ ├── DDTTYLogger.m │ │ └── Extensions │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ ├── DDContextFilterLogFormatter.m │ │ │ ├── DDDispatchQueueLogFormatter.h │ │ │ ├── DDDispatchQueueLogFormatter.m │ │ │ ├── DDMultiFormatter.h │ │ │ └── DDMultiFormatter.m │ ├── LICENSE.txt │ └── README.md ├── Headers │ ├── Private │ │ └── CocoaLumberjack │ │ │ ├── CocoaLumberjack.h │ │ │ ├── DDASLLogCapture.h │ │ │ ├── DDASLLogger.h │ │ │ ├── DDAbstractDatabaseLogger.h │ │ │ ├── DDAssertMacros.h │ │ │ ├── DDContextFilterLogFormatter.h │ │ │ ├── DDDispatchQueueLogFormatter.h │ │ │ ├── DDFileLogger.h │ │ │ ├── DDLegacy.h │ │ │ ├── DDLog+LOGV.h │ │ │ ├── DDLog.h │ │ │ ├── DDLogMacros.h │ │ │ ├── DDMultiFormatter.h │ │ │ └── DDTTYLogger.h │ └── Public │ │ └── CocoaLumberjack │ │ ├── CocoaLumberjack.h │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogger.h │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAssertMacros.h │ │ ├── DDContextFilterLogFormatter.h │ │ ├── DDDispatchQueueLogFormatter.h │ │ ├── DDFileLogger.h │ │ ├── DDLegacy.h │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLogMacros.h │ │ ├── DDMultiFormatter.h │ │ └── DDTTYLogger.h ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── thebitguru.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-Play Button iTunes Patch-CocoaLumberjack.xcscheme │ │ ├── Pods-Play Button iTunes Patch.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── Pods-Play Button iTunes Patch-CocoaLumberjack │ ├── Pods-Play Button iTunes Patch-CocoaLumberjack-Private.xcconfig │ ├── Pods-Play Button iTunes Patch-CocoaLumberjack-dummy.m │ ├── Pods-Play Button iTunes Patch-CocoaLumberjack-prefix.pch │ └── Pods-Play Button iTunes Patch-CocoaLumberjack.xcconfig │ └── Pods-Play Button iTunes Patch │ ├── Pods-Play Button iTunes Patch-acknowledgements.markdown │ ├── Pods-Play Button iTunes Patch-acknowledgements.plist │ ├── Pods-Play Button iTunes Patch-dummy.m │ ├── Pods-Play Button iTunes Patch-environment.h │ ├── Pods-Play Button iTunes Patch-resources.sh │ ├── Pods-Play Button iTunes Patch.debug.xcconfig │ └── Pods-Play Button iTunes Patch.release.xcconfig ├── README.md ├── dmg-background.png ├── dmg-background.tif ├── iTunes Play Button Patch ├── AboutWindow.xib ├── AboutWindowController.h ├── AboutWindowController.m ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── MainMenu.xib ├── Constants.h ├── Constants.m ├── Credits.html ├── CustomLogFormatter.h ├── CustomLogFormatter.m ├── ErrorWindowController.h ├── ErrorWindowController.m ├── ErrorWindowController.xib ├── GradientView.h ├── GradientView.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── NOPE autoplay-2x_128.png │ │ ├── NOPE autoplay-2x_16.png │ │ ├── NOPE autoplay-2x_256.png │ │ ├── NOPE autoplay-2x_32.png │ │ ├── NOPE autoplay-2x_512.png │ │ ├── NOPE autoplay_16.png │ │ ├── NOPE autoplay_256.png │ │ ├── NOPE autoplay_32.png │ │ ├── NOPE autoplay_512.png │ │ └── logo-2 copy.png ├── Info.plist ├── PatchedWindowController.h ├── PatchedWindowController.m ├── PatchedWindowController.xib ├── Patcher.h ├── Patcher.m ├── PlayButtoniTunesPatch-Prefix.pch ├── RcdFile.h ├── RcdFile.m ├── en.lproj │ └── MainMenu.strings ├── logo-large.png ├── logo.png ├── main.m └── notes.txt ├── iTunes Play Button PatchTests ├── Info.plist └── iTunes_Play_Button_PatchTests.m ├── old-cli ├── Patch.command └── edit_rcd_bin.py └── package └── Play Button iTunes Patch.app └── Contents ├── Info.plist ├── MacOS └── Play Button iTunes Patch ├── PkgInfo ├── Resources ├── AboutWindow.nib ├── AppIcon.icns ├── Base.lproj │ └── MainMenu.nib ├── Credits.html ├── logo-large.png ├── logo.png └── notes.txt └── _CodeSignature └── CodeResources /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | rcd/** 4 | package/** 5 | **/thebitguru.xcuserdatad/** 6 | -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_128.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_16.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_256.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_32.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_512.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay-2x_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay-2x_64.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_128.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_16.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_256.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_32.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_512.png -------------------------------------------------------------------------------- /Icons/NOPE autoplay_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Icons/NOPE autoplay_64.png -------------------------------------------------------------------------------- /Images/Screenshot-1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Images/Screenshot-1.0.png -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2010 Farhan Ahmad. 2 | 3 | This program is free software; you can redistribute it and/or modify it under 4 | the terms of the GNU General Public License as published by the Free Software 5 | Foundation; version 2 of the License. 6 | 7 | This program is distributed in the hope that it will be useful, but WITHOUT ANY 8 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 9 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 10 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcodeproj/project.xcworkspace/xcshareddata/Play Button iTunes Patch.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 78878E50-C56E-4993-B028-9E88583C518B 9 | IDESourceControlProjectName 10 | Play Button iTunes Patch 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 14 | github.com:thebitguru/play-button-itunes-patch.git 15 | 16 | IDESourceControlProjectPath 17 | Play Button iTunes Patch.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:thebitguru/play-button-itunes-patch.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 36 | IDESourceControlWCCName 37 | play-button-itunes-patch 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcodeproj/project.xcworkspace/xcuserdata/thebitguru.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebitguru/play-button-itunes-patch/786a239f3b0c6463a80ed5293e1b75929325e3a4/Play Button iTunes Patch.xcodeproj/project.xcworkspace/xcuserdata/thebitguru.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcodeproj/project.xcworkspace/xcuserdata/thebitguru.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcodeproj/xcshareddata/xcschemes/Play Button iTunes Patch.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Play Button iTunes Patch.xcworkspace/xcshareddata/Play Button iTunes Patch.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 5EC70C97-1935-44DF-83C6-C52353AED253 9 | IDESourceControlProjectName 10 | Play Button iTunes Patch 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 14 | github.com:thebitguru/play-button-itunes-patch.git 15 | 16 | IDESourceControlProjectPath 17 | Play Button iTunes Patch.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 21 | .. 22 | 23 | IDESourceControlProjectURL 24 | github.com:thebitguru/play-button-itunes-patch.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 38B64F689B39CBF666CFCC0345ED0BF865D4E737 36 | IDESourceControlWCCName 37 | play-button-itunes-patch 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '6.0' 3 | 4 | target 'Play Button iTunes Patch' do 5 | # pod 'FontAwesomeKit' 6 | pod 'CocoaLumberjack', "~> 2.0.0-rc" 7 | end 8 | 9 | target 'Play Button iTunes PatchTests' do 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (2.0.0-rc): 3 | - CocoaLumberjack/Default (= 2.0.0-rc) 4 | - CocoaLumberjack/Extensions (= 2.0.0-rc) 5 | - CocoaLumberjack/Core (2.0.0-rc) 6 | - CocoaLumberjack/Default (2.0.0-rc): 7 | - CocoaLumberjack/Core 8 | - CocoaLumberjack/Extensions (2.0.0-rc): 9 | - CocoaLumberjack/Default 10 | 11 | DEPENDENCIES: 12 | - CocoaLumberjack (~> 2.0.0-rc) 13 | 14 | SPEC CHECKSUMS: 15 | CocoaLumberjack: 6186e27827fc574b50b16c10102fcc591437f06c 16 | 17 | COCOAPODS: 0.36.0.beta.2 18 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 | // Legacy 63 | #ifndef DDLEGACY 64 | #define DDLEGACY NO 65 | #endif 66 | 67 | // Core 68 | #import "DDLog.h" 69 | 70 | // Main macros 71 | #import "DDLogMacros.h" 72 | #import "DDAssertMacros.h" 73 | 74 | // Capture ASL 75 | #import "DDASLLogCapture.h" 76 | 77 | // Loggers 78 | #import "DDTTYLogger.h" 79 | #import "DDASLLogger.h" 80 | #import "DDFileLogger.h" 81 | 82 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/CocoaLumberjack.swift: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2014, 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 Foundation 17 | import CocoaLumberjack 18 | 19 | extension DDLogFlag { 20 | public static func fromLogLevel(logLevel: DDLogLevel) -> DDLogFlag { 21 | return DDLogFlag(logLevel.rawValue) 22 | } 23 | 24 | /** 25 | * returns the log level, or the lowest equivalant. 26 | */ 27 | public func toLogLevel() -> DDLogLevel { 28 | if let ourValid = DDLogLevel(rawValue: self.rawValue) { 29 | return ourValid 30 | } else { 31 | let logFlag = self 32 | if logFlag & .Verbose == .Verbose { 33 | return .Error 34 | } else if logFlag & .Debug == .Debug { 35 | return .Debug 36 | } else if logFlag & .Info == .Info { 37 | return .Info 38 | } else if logFlag & .Warning == .Warning { 39 | return .Warning 40 | } else if logFlag & .Error == .Error { 41 | return .Verbose 42 | } else { 43 | return .Off 44 | } 45 | } 46 | } 47 | } 48 | 49 | extension DDMultiFormatter { 50 | public var formatterArray: [DDLogFormatter] { 51 | return self.formatters as [DDLogFormatter] 52 | } 53 | } 54 | 55 | public var defaultDebugLevel = DDLogLevel.Warning 56 | 57 | public func resetDefaultDebugLevel() { 58 | defaultDebugLevel = DDLogLevel.Warning 59 | } 60 | 61 | public func SwiftLogMacro(async: Bool, level: DDLogLevel, flag flg: DDLogFlag, context: UInt = 0, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, tag: AnyObject? = nil, #format: String, #args: CVaListPointer) { 62 | let string = NSString(format: format, arguments: args) as String 63 | SwiftLogMacro(async, level, flag: flg, context: context, file: file, function: function, line: line, tag: tag, string) 64 | } 65 | public func SwiftLogMacro(isAsynchronous: Bool, level: DDLogLevel, flag flg: DDLogFlag, context: UInt = 0, file: String = __FILE__, function: String = __FUNCTION__, line: UInt = __LINE__, tag: AnyObject? = nil, string: String) { 66 | // Tell the DDLogMessage constructor to copy the C strings that get passed to it. 67 | let logMessage = DDLogMessage(message: string, level: level, flag: flg, context: context, file: file, function: function, line: line, tag: tag, options: .CopyFile | .CopyFunction, timestamp: nil) 68 | DDLog.log(isAsynchronous, message: logMessage) 69 | } 70 | 71 | public func DDLogDebug(logText: String, level: DDLogLevel = defaultDebugLevel, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, asynchronous async: Bool = true, #args: CVarArgType...) { 72 | SwiftLogMacro(async, level, flag: .Debug, file: file, function: function, line: line, format: logText, args: getVaList(args)) 73 | } 74 | 75 | public func DDLogInfo(logText: String, level: DDLogLevel = defaultDebugLevel, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, asynchronous async: Bool = true, #args: CVarArgType...) { 76 | SwiftLogMacro(async, level, flag: .Info, file: file, function: function, line: line, format: logText, args: getVaList(args)) 77 | } 78 | 79 | public func DDLogWarn(logText: String, level: DDLogLevel = defaultDebugLevel, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, asynchronous async: Bool = true, #args: CVarArgType...) { 80 | SwiftLogMacro(async, level, flag: .Warning, file: file, function: function, line: line, format: logText, args: getVaList(args)) 81 | } 82 | 83 | public func DDLogVerbose(logText: String, level: DDLogLevel = defaultDebugLevel, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, asynchronous async: Bool = true, #args: CVarArgType...) { 84 | SwiftLogMacro(async, level, flag: .Verbose, file: file, function: function, line: line, format: logText, args: getVaList(args)) 85 | } 86 | 87 | public func DDLogError(logText: String, level: DDLogLevel = defaultDebugLevel, file: String = __FILE__, function: String = __FUNCTION__, line: UWord = __LINE__, asynchronous async: Bool = false, #args: CVarArgType...) { 88 | SwiftLogMacro(async, level, flag: .Error, file: file, function: function, line: line, format: logText, args: getVaList(args)) 89 | } 90 | 91 | /*! 92 | * Analogous to the C preprocessor macro \c THIS_FILE 93 | */ 94 | public func CurrentFileName(fileName: String = __FILE__) -> String { 95 | return fileName.lastPathComponent.stringByDeletingPathExtension 96 | } 97 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 | @protocol DDLogger; 19 | 20 | /** 21 | * This class provides the ability to capture the ASL (Apple System Logs) 22 | */ 23 | @interface DDASLLogCapture : NSObject 24 | 25 | + (void)start; 26 | + (void)stop; 27 | 28 | // Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). 29 | + (DDLogLevel)captureLevel; 30 | + (void)setCaptureLevel:(DDLogLevel)level; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogCapture.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 | #import "DDLog.h" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | static BOOL _cancel = YES; 25 | static DDLogLevel _captureLevel = DDLogLevelVerbose; 26 | 27 | #ifdef __IPHONE_8_0 28 | #define DDASL_IOS_PIVOT_VERSION __IPHONE_8_0 29 | #endif 30 | #ifdef __MAC_10_10 31 | #define DDASL_OSX_PIVOT_VERSION __MAC_10_10 32 | #endif 33 | 34 | @implementation DDASLLogCapture 35 | 36 | static aslmsg (*dd_asl_next)(aslresponse obj); 37 | static void (*dd_asl_release)(aslresponse obj); 38 | 39 | + (void)initialize 40 | { 41 | #if (defined(DDASL_IOS_PIVOT_VERSION) && __IPHONE_OS_VERSION_MAX_ALLOWED >= DDASL_IOS_PIVOT_VERSION) || (defined(DDASL_OSX_PIVOT_VERSION) && __MAC_OS_X_VERSION_MAX_ALLOWED >= DDASL_OSX_PIVOT_VERSION) 42 | #if __IPHONE_OS_VERSION_MIN_REQUIRED < DDASL_IOS_PIVOT_VERSION || __MAC_OS_X_VERSION_MIN_REQUIRED < DDASL_OSX_PIVOT_VERSION 43 | #pragma GCC diagnostic push 44 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 45 | // Building on falsely advertised SDK, targeting deprecated API 46 | dd_asl_next = &aslresponse_next; 47 | dd_asl_release = &aslresponse_free; 48 | #pragma GCC diagnostic pop 49 | #else 50 | // Building on lastest, correct SDK, targeting latest API 51 | dd_asl_next = &asl_next; 52 | dd_asl_release = &asl_release; 53 | #endif 54 | #else 55 | // Building on old SDKs, targeting deprecated API 56 | dd_asl_next = &aslresponse_next; 57 | dd_asl_release = &aslresponse_free; 58 | #endif 59 | } 60 | 61 | + (void)start { 62 | // Ignore subsequent calls 63 | if (!_cancel) { 64 | return; 65 | } 66 | 67 | _cancel = NO; 68 | 69 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { 70 | [DDASLLogCapture captureAslLogs]; 71 | }); 72 | } 73 | 74 | + (void)stop { 75 | _cancel = YES; 76 | } 77 | 78 | + (DDLogLevel)captureLevel { 79 | return _captureLevel; 80 | } 81 | 82 | + (void)setCaptureLevel:(DDLogLevel)level { 83 | _captureLevel = level; 84 | } 85 | 86 | #pragma mark - Private methods 87 | 88 | + (void)configureAslQuery:(aslmsg)query { 89 | const char param[] = "7"; // ASL_LEVEL_DEBUG, which is everything. We'll rely on regular DDlog log level to filter 90 | 91 | asl_set_query(query, ASL_KEY_LEVEL, param, ASL_QUERY_OP_LESS_EQUAL | ASL_QUERY_OP_NUMERIC); 92 | 93 | #if !TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 94 | int processId = [[NSProcessInfo processInfo] processIdentifier]; 95 | char pid[16]; 96 | sprintf(pid, "%d", processId); 97 | asl_set_query(query, ASL_KEY_PID, pid, ASL_QUERY_OP_EQUAL | ASL_QUERY_OP_NUMERIC); 98 | #endif 99 | } 100 | 101 | + (void)aslMessageRecieved:(aslmsg)msg { 102 | const char* messageCString = asl_get( msg, ASL_KEY_MSG ); 103 | if ( messageCString == NULL ) 104 | return; 105 | 106 | // NSString * sender = [NSString stringWithCString:asl_get(msg, ASL_KEY_SENDER) encoding:NSUTF8StringEncoding]; 107 | NSString *message = @(messageCString); 108 | NSString *level = @(asl_get(msg, ASL_KEY_LEVEL)); 109 | NSString *secondsStr = @(asl_get(msg, ASL_KEY_TIME)); 110 | NSString *nanoStr = @(asl_get(msg, ASL_KEY_TIME_NSEC)); 111 | 112 | NSTimeInterval seconds = [secondsStr doubleValue]; 113 | NSTimeInterval nanoSeconds = [nanoStr doubleValue]; 114 | NSTimeInterval totalSeconds = seconds + (nanoSeconds / 1e9); 115 | 116 | NSDate *timeStamp = [NSDate dateWithTimeIntervalSince1970:totalSeconds]; 117 | 118 | int flag; 119 | BOOL async; 120 | 121 | switch ([level intValue]) { 122 | // By default all NSLog's with a ASL_LEVEL_WARNING level 123 | case ASL_LEVEL_EMERG : 124 | case ASL_LEVEL_ALERT : 125 | case ASL_LEVEL_CRIT : flag = DDLogFlagError; async = NO; break; 126 | case ASL_LEVEL_ERR : flag = DDLogFlagWarning; async = YES; break; 127 | case ASL_LEVEL_WARNING : flag = DDLogFlagInfo; async = YES; break; 128 | case ASL_LEVEL_NOTICE : flag = DDLogFlagDebug; async = YES; break; 129 | case ASL_LEVEL_INFO : 130 | case ASL_LEVEL_DEBUG : 131 | default : flag = DDLogFlagVerbose; async = YES; break; 132 | } 133 | 134 | if (!(_captureLevel & flag)) { 135 | return; 136 | } 137 | 138 | DDLogMessage *logMessage = [[DDLogMessage alloc]initWithMessage:message 139 | level:_captureLevel 140 | flag:flag 141 | context:0 142 | file:@"DDASLLogCapture" 143 | function:0 144 | line:0 145 | tag:nil 146 | options:0 147 | timestamp:timeStamp]; 148 | 149 | [DDLog log:async message:logMessage]; 150 | } 151 | 152 | + (void)captureAslLogs { 153 | @autoreleasepool 154 | { 155 | /* 156 | We use ASL_KEY_MSG_ID to see each message once, but there's no 157 | obvious way to get the "next" ID. To bootstrap the process, we'll 158 | search by timestamp until we've seen a message. 159 | */ 160 | 161 | struct timeval timeval = { 162 | .tv_sec = 0 163 | }; 164 | gettimeofday(&timeval, NULL); 165 | unsigned long long startTime = timeval.tv_sec; 166 | __block unsigned long long lastSeenID = 0; 167 | 168 | /* 169 | syslogd posts kNotifyASLDBUpdate (com.apple.system.logger.message) 170 | through the notify API when it saves messages to the ASL database. 171 | There is some coalescing - currently it is sent at most twice per 172 | second - but there is no documented guarantee about this. In any 173 | case, there may be multiple messages per notification. 174 | 175 | Notify notifications don't carry any payload, so we need to search 176 | for the messages. 177 | */ 178 | int notifyToken = 0; // Can be used to unregister with notify_cancel(). 179 | notify_register_dispatch(kNotifyASLDBUpdate, ¬ifyToken, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(int token) 180 | { 181 | // At least one message has been posted; build a search query. 182 | @autoreleasepool 183 | { 184 | aslmsg query = asl_new(ASL_TYPE_QUERY); 185 | char stringValue[64]; 186 | 187 | if (lastSeenID > 0) { 188 | snprintf(stringValue, sizeof stringValue, "%llu", lastSeenID); 189 | asl_set_query(query, ASL_KEY_MSG_ID, stringValue, ASL_QUERY_OP_GREATER | ASL_QUERY_OP_NUMERIC); 190 | } else { 191 | snprintf(stringValue, sizeof stringValue, "%llu", startTime); 192 | asl_set_query(query, ASL_KEY_TIME, stringValue, ASL_QUERY_OP_GREATER_EQUAL | ASL_QUERY_OP_NUMERIC); 193 | } 194 | 195 | [DDASLLogCapture configureAslQuery:query]; 196 | 197 | // Iterate over new messages. 198 | aslmsg msg; 199 | aslresponse response = asl_search(NULL, query); 200 | 201 | while ((msg = dd_asl_next(response))) 202 | { 203 | [DDASLLogCapture aslMessageRecieved:msg]; 204 | 205 | // Keep track of which messages we've seen. 206 | lastSeenID = atoll(asl_get(msg, ASL_KEY_MSG_ID)); 207 | } 208 | dd_asl_release(response); 209 | 210 | if (_cancel) { 211 | notify_cancel(notifyToken); 212 | return; 213 | } 214 | 215 | free(query); 216 | } 217 | }); 218 | } 219 | } 220 | 221 | @end 222 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 "DDLog.h" 18 | 19 | /** 20 | * This class provides a logger for the Apple System Log facility. 21 | * 22 | * As described in the "Getting Started" page, 23 | * the traditional NSLog() function directs it's output to two places: 24 | * 25 | * - Apple System Log 26 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 27 | * 28 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 29 | * However, if you instead choose to use file logging (for faster performance), 30 | * you may choose to use a file logger and a tty logger. 31 | **/ 32 | 33 | @interface DDASLLogger : DDAbstractLogger 34 | 35 | + (instancetype)sharedInstance; 36 | 37 | // Inherited from DDAbstractLogger 38 | 39 | // - (id )logFormatter; 40 | // - (void)setLogFormatter:(id )formatter; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 | #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 | static DDASLLogger *sharedInstance; 24 | 25 | @interface DDASLLogger () { 26 | aslclient _client; 27 | } 28 | 29 | @end 30 | 31 | 32 | @implementation DDASLLogger 33 | 34 | + (instancetype)sharedInstance { 35 | static dispatch_once_t DDASLLoggerOnceToken; 36 | 37 | dispatch_once(&DDASLLoggerOnceToken, ^{ 38 | sharedInstance = [[[self class] alloc] init]; 39 | }); 40 | 41 | return sharedInstance; 42 | } 43 | 44 | - (instancetype)init { 45 | if (sharedInstance != nil) { 46 | return nil; 47 | } 48 | 49 | if ((self = [super init])) { 50 | // A default asl client is provided for the main thread, 51 | // but background threads need to create their own client. 52 | 53 | _client = asl_open(NULL, "com.apple.console", 0); 54 | } 55 | 56 | return self; 57 | } 58 | 59 | - (void)logMessage:(DDLogMessage *)logMessage { 60 | // Skip captured log messages 61 | if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { 62 | return; 63 | } 64 | 65 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 66 | 67 | if (logMessage) { 68 | const char *msg = [message UTF8String]; 69 | 70 | size_t aslLogLevel; 71 | switch (logMessage->_flag) { 72 | // Note: By default ASL will filter anything above level 5 (Notice). 73 | // So our mappings shouldn't go above that level. 74 | case DDLogFlagError : aslLogLevel = ASL_LEVEL_CRIT; break; 75 | case DDLogFlagWarning : aslLogLevel = ASL_LEVEL_ERR; break; 76 | case DDLogFlagInfo : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level 77 | case DDLogFlagDebug : 78 | case DDLogFlagVerbose : 79 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 80 | } 81 | 82 | static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; 83 | 84 | // NSLog uses the current euid to set the ASL_KEY_READ_UID. 85 | uid_t const readUID = geteuid(); 86 | 87 | char readUIDString[16]; 88 | #ifndef NS_BLOCK_ASSERTIONS 89 | int l = snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 90 | #else 91 | snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 92 | #endif 93 | 94 | NSAssert(l < sizeof(readUIDString), 95 | @"Formatted euid is too long."); 96 | NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), 97 | @"Unhandled ASL log level."); 98 | 99 | aslmsg m = asl_new(ASL_TYPE_MSG); 100 | if (m != NULL) { 101 | if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && 102 | asl_set(m, ASL_KEY_MSG, msg) == 0 && 103 | asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0) { 104 | asl_send(_client, m); 105 | } 106 | asl_free(m); 107 | } 108 | //TODO handle asl_* failures non-silently? 109 | } 110 | } 111 | 112 | - (NSString *)loggerName { 113 | return @"cocoa.lumberjack.aslLogger"; 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 "DDLog.h" 17 | 18 | /** 19 | * This class provides an abstract implementation of a database logger. 20 | * 21 | * That is, it provides the base implementation for a database logger to build atop of. 22 | * All that is needed for a concrete database logger is to extend this class 23 | * and override the methods in the implementation file that are prefixed with "db_". 24 | **/ 25 | 26 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 27 | 28 | @protected 29 | NSUInteger _saveThreshold; 30 | NSTimeInterval _saveInterval; 31 | NSTimeInterval _maxAge; 32 | NSTimeInterval _deleteInterval; 33 | BOOL _deleteOnEverySave; 34 | 35 | BOOL _saveTimerSuspended; 36 | NSUInteger _unsavedCount; 37 | dispatch_time_t _unsavedTime; 38 | dispatch_source_t _saveTimer; 39 | dispatch_time_t _lastDeleteTime; 40 | dispatch_source_t _deleteTimer; 41 | } 42 | 43 | /** 44 | * Specifies how often to save the data to disk. 45 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 46 | * These properties allow you to configure how/when the logger saves to disk. 47 | * 48 | * A save is done when either (whichever happens first): 49 | * 50 | * - The number of unsaved log entries reaches saveThreshold 51 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 52 | * 53 | * You can optionally disable the saveThreshold by setting it to zero. 54 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 55 | * 56 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 57 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 58 | * 59 | * It's not wise to disable both saveThreshold and saveInterval. 60 | * 61 | * The default saveThreshold is 500. 62 | * The default saveInterval is 60 seconds. 63 | **/ 64 | @property (assign, readwrite) NSUInteger saveThreshold; 65 | @property (assign, readwrite) NSTimeInterval saveInterval; 66 | 67 | /** 68 | * It is likely you don't want the log entries to persist forever. 69 | * Doing so would allow the database to grow infinitely large over time. 70 | * 71 | * The maxAge property provides a way to specify how old a log statement can get 72 | * before it should get deleted from the database. 73 | * 74 | * The deleteInterval specifies how often to sweep for old log entries. 75 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 76 | * 77 | * An alternative to the deleteInterval is the deleteOnEverySave option. 78 | * This specifies that old log entries should be deleted during every save operation. 79 | * 80 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 81 | * If you disable the maxAge then old log statements are not deleted. 82 | * 83 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 84 | * 85 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 86 | * 87 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 88 | * 89 | * The default maxAge is 7 days. 90 | * The default deleteInterval is 5 minutes. 91 | * The default deleteOnEverySave is NO. 92 | **/ 93 | @property (assign, readwrite) NSTimeInterval maxAge; 94 | @property (assign, readwrite) NSTimeInterval deleteInterval; 95 | @property (assign, readwrite) BOOL deleteOnEverySave; 96 | 97 | /** 98 | * Forces a save of any pending log entries (flushes log entries to disk). 99 | **/ 100 | - (void)savePendingLogEntries; 101 | 102 | /** 103 | * Removes any log entries that are older than maxAge. 104 | **/ 105 | - (void)deleteOldLogEntries; 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 | * NSAsset 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 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDFileLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2014, 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 "DDLog.h" 17 | 18 | @class DDLogFileInfo; 19 | 20 | /** 21 | * This class provides a logger to write log statements to a file. 22 | **/ 23 | 24 | 25 | // Default configuration and safety/sanity values. 26 | // 27 | // maximumFileSize -> kDDDefaultLogMaxFileSize 28 | // rollingFrequency -> kDDDefaultLogRollingFrequency 29 | // maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles 30 | // logFilesDiskQuota -> kDDDefaultLogFilesDiskQuota 31 | // 32 | // You should carefully consider the proper configuration values for your application. 33 | 34 | extern unsigned long long const kDDDefaultLogMaxFileSize; 35 | extern NSTimeInterval const kDDDefaultLogRollingFrequency; 36 | extern NSUInteger const kDDDefaultLogMaxNumLogFiles; 37 | extern unsigned long long const kDDDefaultLogFilesDiskQuota; 38 | 39 | 40 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 41 | #pragma mark - 42 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 43 | 44 | // The LogFileManager protocol is designed to allow you to control all aspects of your log files. 45 | // 46 | // The primary purpose of this is to allow you to do something with the log files after they have been rolled. 47 | // Perhaps you want to compress them to save disk space. 48 | // Perhaps you want to upload them to an FTP server. 49 | // Perhaps you want to run some analytics on the file. 50 | // 51 | // A default LogFileManager is, of course, provided. 52 | // The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property. 53 | // 54 | // This protocol provides various methods to fetch the list of log files. 55 | // 56 | // There are two variants: sorted and unsorted. 57 | // If sorting is not necessary, the unsorted variant is obviously faster. 58 | // The sorted variant will return an array sorted by when the log files were created, 59 | // with the most recently created log file at index 0, and the oldest log file at the end of the array. 60 | // 61 | // You can fetch only the log file paths (full path including name), log file names (name only), 62 | // or an array of DDLogFileInfo objects. 63 | // The DDLogFileInfo class is documented below, and provides a handy wrapper that 64 | // gives you easy access to various file attributes such as the creation date or the file size. 65 | 66 | @protocol DDLogFileManager 67 | @required 68 | 69 | // Public properties 70 | 71 | /** 72 | * The maximum number of archived log files to keep on disk. 73 | * For example, if this property is set to 3, 74 | * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk. 75 | * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted. 76 | * 77 | * You may optionally disable this option by setting it to zero. 78 | **/ 79 | @property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles; 80 | 81 | /** 82 | * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will 83 | * be deleted. 84 | * 85 | * You may optionally disable this option by setting it to zero. 86 | **/ 87 | @property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota; 88 | 89 | // Public methods 90 | 91 | - (NSString *)logsDirectory; 92 | 93 | - (NSArray *)unsortedLogFilePaths; 94 | - (NSArray *)unsortedLogFileNames; 95 | - (NSArray *)unsortedLogFileInfos; 96 | 97 | - (NSArray *)sortedLogFilePaths; 98 | - (NSArray *)sortedLogFileNames; 99 | - (NSArray *)sortedLogFileInfos; 100 | 101 | // Private methods (only to be used by DDFileLogger) 102 | 103 | - (NSString *)createNewLogFile; 104 | 105 | @optional 106 | 107 | // Notifications from DDFileLogger 108 | 109 | - (void)didArchiveLogFile:(NSString *)logFilePath; 110 | - (void)didRollAndArchiveLogFile:(NSString *)logFilePath; 111 | 112 | @end 113 | 114 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 115 | #pragma mark - 116 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 117 | 118 | /** 119 | * Default log file manager. 120 | * 121 | * All log files are placed inside the logsDirectory. 122 | * If a specific logsDirectory isn't specified, the default directory is used. 123 | * On Mac, this is in ~/Library/Logs/. 124 | * On iPhone, this is in ~/Library/Caches/Logs. 125 | * 126 | * Log files are named "