├── .gitignore ├── Example.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── parrots.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── parrots.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── Example.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── parrots.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── Example ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Example-Bridging-Header.h ├── Info.plist ├── LogInitializer.swift ├── Logging.h ├── MFMailComposeViewController+Feedback.h ├── MFMailComposeViewController+Feedback.m ├── ViewController.h ├── ViewController.m └── main.m ├── Podfile ├── Podfile.lock ├── README.md └── Vendor └── CrashlyticsLumberjack ├── CrashlyticsLogger.h └── CrashlyticsLogger.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /Pods 3 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 817A99F5209403110059B6B9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A99F4209403110059B6B9 /* AppDelegate.m */; }; 11 | 817A99F8209403110059B6B9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A99F7209403110059B6B9 /* ViewController.m */; }; 12 | 817A99FB209403110059B6B9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 817A99F9209403110059B6B9 /* Main.storyboard */; }; 13 | 817A99FD209403130059B6B9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 817A99FC209403130059B6B9 /* Assets.xcassets */; }; 14 | 817A9A00209403130059B6B9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 817A99FE209403130059B6B9 /* LaunchScreen.storyboard */; }; 15 | 817A9A03209403130059B6B9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A9A02209403130059B6B9 /* main.m */; }; 16 | 817A9A0D209403C30059B6B9 /* CrashlyticsLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A9A0C209403C30059B6B9 /* CrashlyticsLogger.m */; }; 17 | 817A9A10209404650059B6B9 /* LogInitializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817A9A0F209404650059B6B9 /* LogInitializer.swift */; }; 18 | 817A9A172094072A0059B6B9 /* MFMailComposeViewController+Feedback.m in Sources */ = {isa = PBXBuildFile; fileRef = 817A9A152094072A0059B6B9 /* MFMailComposeViewController+Feedback.m */; }; 19 | B8F71E4028BE57ACCF8B0C62 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 550D7FFF53CEFBCD7D2E8320 /* Pods_Example.framework */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 550D7FFF53CEFBCD7D2E8320 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 817A99F0209403110059B6B9 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 817A99F3209403110059B6B9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 817A99F4209403110059B6B9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 817A99F6209403110059B6B9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | 817A99F7209403110059B6B9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | 817A99FA209403110059B6B9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 817A99FC209403130059B6B9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | 817A99FF209403130059B6B9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 817A9A01209403130059B6B9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 817A9A02209403130059B6B9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | 817A9A0B209403C30059B6B9 /* CrashlyticsLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashlyticsLogger.h; sourceTree = ""; }; 35 | 817A9A0C209403C30059B6B9 /* CrashlyticsLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CrashlyticsLogger.m; sourceTree = ""; }; 36 | 817A9A0E209404640059B6B9 /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Bridging-Header.h"; sourceTree = ""; }; 37 | 817A9A0F209404650059B6B9 /* LogInitializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogInitializer.swift; sourceTree = ""; }; 38 | 817A9A14209405800059B6B9 /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = ""; }; 39 | 817A9A152094072A0059B6B9 /* MFMailComposeViewController+Feedback.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MFMailComposeViewController+Feedback.m"; sourceTree = ""; }; 40 | 817A9A162094072A0059B6B9 /* MFMailComposeViewController+Feedback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MFMailComposeViewController+Feedback.h"; sourceTree = ""; }; 41 | 8D316A2C849BA17876C8F3EF /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 42 | A5DD6C1E73802834320CD286 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 817A99ED209403110059B6B9 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | B8F71E4028BE57ACCF8B0C62 /* Pods_Example.framework in Frameworks */, 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | /* End PBXFrameworksBuildPhase section */ 55 | 56 | /* Begin PBXGroup section */ 57 | 817A99E7209403110059B6B9 = { 58 | isa = PBXGroup; 59 | children = ( 60 | 817A99F2209403110059B6B9 /* Example */, 61 | 817A9A09209403C30059B6B9 /* Vendor */, 62 | 817A99F1209403110059B6B9 /* Products */, 63 | C4DD0D062B950F1B8809C831 /* Pods */, 64 | D892D3AA1B280CF0D1577BF0 /* Frameworks */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | 817A99F1209403110059B6B9 /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 817A99F0209403110059B6B9 /* Example.app */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | 817A99F2209403110059B6B9 /* Example */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 817A99F3209403110059B6B9 /* AppDelegate.h */, 80 | 817A99F4209403110059B6B9 /* AppDelegate.m */, 81 | 817A99F6209403110059B6B9 /* ViewController.h */, 82 | 817A99F7209403110059B6B9 /* ViewController.m */, 83 | 817A9A0F209404650059B6B9 /* LogInitializer.swift */, 84 | 817A9A14209405800059B6B9 /* Logging.h */, 85 | 817A9A162094072A0059B6B9 /* MFMailComposeViewController+Feedback.h */, 86 | 817A9A152094072A0059B6B9 /* MFMailComposeViewController+Feedback.m */, 87 | 817A99F9209403110059B6B9 /* Main.storyboard */, 88 | 817A99FC209403130059B6B9 /* Assets.xcassets */, 89 | 817A99FE209403130059B6B9 /* LaunchScreen.storyboard */, 90 | 817A9A01209403130059B6B9 /* Info.plist */, 91 | 817A9A02209403130059B6B9 /* main.m */, 92 | 817A9A0E209404640059B6B9 /* Example-Bridging-Header.h */, 93 | ); 94 | path = Example; 95 | sourceTree = ""; 96 | }; 97 | 817A9A09209403C30059B6B9 /* Vendor */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 817A9A0A209403C30059B6B9 /* CrashlyticsLumberjack */, 101 | ); 102 | path = Vendor; 103 | sourceTree = ""; 104 | }; 105 | 817A9A0A209403C30059B6B9 /* CrashlyticsLumberjack */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 817A9A0B209403C30059B6B9 /* CrashlyticsLogger.h */, 109 | 817A9A0C209403C30059B6B9 /* CrashlyticsLogger.m */, 110 | ); 111 | path = CrashlyticsLumberjack; 112 | sourceTree = ""; 113 | }; 114 | C4DD0D062B950F1B8809C831 /* Pods */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 8D316A2C849BA17876C8F3EF /* Pods-Example.debug.xcconfig */, 118 | A5DD6C1E73802834320CD286 /* Pods-Example.release.xcconfig */, 119 | ); 120 | name = Pods; 121 | sourceTree = ""; 122 | }; 123 | D892D3AA1B280CF0D1577BF0 /* Frameworks */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 550D7FFF53CEFBCD7D2E8320 /* Pods_Example.framework */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | 817A99EF209403110059B6B9 /* Example */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = 817A9A06209403130059B6B9 /* Build configuration list for PBXNativeTarget "Example" */; 137 | buildPhases = ( 138 | C1555107BE1905AB2D665DF0 /* [CP] Check Pods Manifest.lock */, 139 | 817A99EC209403110059B6B9 /* Sources */, 140 | 817A99ED209403110059B6B9 /* Frameworks */, 141 | 817A99EE209403110059B6B9 /* Resources */, 142 | 218A883364F90B75C185D6D2 /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Example; 149 | productName = Example; 150 | productReference = 817A99F0209403110059B6B9 /* Example.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 817A99E8209403110059B6B9 /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1000; 160 | ORGANIZATIONNAME = "Curtis Herbert"; 161 | TargetAttributes = { 162 | 817A99EF209403110059B6B9 = { 163 | CreatedOnToolsVersion = 9.3; 164 | LastSwiftMigration = 0930; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 817A99EB209403110059B6B9 /* Build configuration list for PBXProject "Example" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 817A99E7209403110059B6B9; 177 | productRefGroup = 817A99F1209403110059B6B9 /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 817A99EF209403110059B6B9 /* Example */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 817A99EE209403110059B6B9 /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 817A9A00209403130059B6B9 /* LaunchScreen.storyboard in Resources */, 192 | 817A99FD209403130059B6B9 /* Assets.xcassets in Resources */, 193 | 817A99FB209403110059B6B9 /* Main.storyboard in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXShellScriptBuildPhase section */ 200 | 218A883364F90B75C185D6D2 /* [CP] Embed Pods Frameworks */ = { 201 | isa = PBXShellScriptBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | inputPaths = ( 206 | "${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", 207 | "${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework", 208 | ); 209 | name = "[CP] Embed Pods Frameworks"; 210 | outputPaths = ( 211 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework", 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | shellPath = /bin/sh; 215 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; 216 | showEnvVarsInLog = 0; 217 | }; 218 | C1555107BE1905AB2D665DF0 /* [CP] Check Pods Manifest.lock */ = { 219 | isa = PBXShellScriptBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | ); 223 | inputPaths = ( 224 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 225 | "${PODS_ROOT}/Manifest.lock", 226 | ); 227 | name = "[CP] Check Pods Manifest.lock"; 228 | outputPaths = ( 229 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | shellPath = /bin/sh; 233 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 234 | showEnvVarsInLog = 0; 235 | }; 236 | /* End PBXShellScriptBuildPhase section */ 237 | 238 | /* Begin PBXSourcesBuildPhase section */ 239 | 817A99EC209403110059B6B9 /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | 817A9A172094072A0059B6B9 /* MFMailComposeViewController+Feedback.m in Sources */, 244 | 817A99F8209403110059B6B9 /* ViewController.m in Sources */, 245 | 817A9A10209404650059B6B9 /* LogInitializer.swift in Sources */, 246 | 817A9A03209403130059B6B9 /* main.m in Sources */, 247 | 817A99F5209403110059B6B9 /* AppDelegate.m in Sources */, 248 | 817A9A0D209403C30059B6B9 /* CrashlyticsLogger.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXVariantGroup section */ 255 | 817A99F9209403110059B6B9 /* Main.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 817A99FA209403110059B6B9 /* Base */, 259 | ); 260 | name = Main.storyboard; 261 | sourceTree = ""; 262 | }; 263 | 817A99FE209403130059B6B9 /* LaunchScreen.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | 817A99FF209403130059B6B9 /* Base */, 267 | ); 268 | name = LaunchScreen.storyboard; 269 | sourceTree = ""; 270 | }; 271 | /* End PBXVariantGroup section */ 272 | 273 | /* Begin XCBuildConfiguration section */ 274 | 817A9A04209403130059B6B9 /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | CLANG_ANALYZER_NONNULL = YES; 279 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 280 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 281 | CLANG_CXX_LIBRARY = "libc++"; 282 | CLANG_ENABLE_MODULES = YES; 283 | CLANG_ENABLE_OBJC_ARC = YES; 284 | CLANG_ENABLE_OBJC_WEAK = YES; 285 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 286 | CLANG_WARN_BOOL_CONVERSION = YES; 287 | CLANG_WARN_COMMA = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 292 | CLANG_WARN_EMPTY_BODY = YES; 293 | CLANG_WARN_ENUM_CONVERSION = YES; 294 | CLANG_WARN_INFINITE_RECURSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 297 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 298 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 299 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 300 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 301 | CLANG_WARN_STRICT_PROTOTYPES = YES; 302 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 303 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 304 | CLANG_WARN_UNREACHABLE_CODE = YES; 305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 306 | CODE_SIGN_IDENTITY = "iPhone Developer"; 307 | COPY_PHASE_STRIP = NO; 308 | DEBUG_INFORMATION_FORMAT = dwarf; 309 | ENABLE_STRICT_OBJC_MSGSEND = YES; 310 | ENABLE_TESTABILITY = YES; 311 | GCC_C_LANGUAGE_STANDARD = gnu11; 312 | GCC_DYNAMIC_NO_PIC = NO; 313 | GCC_NO_COMMON_BLOCKS = YES; 314 | GCC_OPTIMIZATION_LEVEL = 0; 315 | GCC_PREPROCESSOR_DEFINITIONS = ( 316 | "DEBUG=1", 317 | "$(inherited)", 318 | ); 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 326 | MTL_ENABLE_DEBUG_INFO = YES; 327 | ONLY_ACTIVE_ARCH = YES; 328 | OTHER_SWIFT_FLAGS = "-DDEBUG"; 329 | SDKROOT = iphoneos; 330 | }; 331 | name = Debug; 332 | }; 333 | 817A9A05209403130059B6B9 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_ENABLE_OBJC_WEAK = YES; 344 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 345 | CLANG_WARN_BOOL_CONVERSION = YES; 346 | CLANG_WARN_COMMA = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INFINITE_RECURSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 357 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 358 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 359 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 360 | CLANG_WARN_STRICT_PROTOTYPES = YES; 361 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 362 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 363 | CLANG_WARN_UNREACHABLE_CODE = YES; 364 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 365 | CODE_SIGN_IDENTITY = "iPhone Developer"; 366 | COPY_PHASE_STRIP = NO; 367 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 368 | ENABLE_NS_ASSERTIONS = NO; 369 | ENABLE_STRICT_OBJC_MSGSEND = YES; 370 | GCC_C_LANGUAGE_STANDARD = gnu11; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 379 | MTL_ENABLE_DEBUG_INFO = NO; 380 | OTHER_SWIFT_FLAGS = "-DRELEASE"; 381 | SDKROOT = iphoneos; 382 | SWIFT_COMPILATION_MODE = wholemodule; 383 | VALIDATE_PRODUCT = YES; 384 | }; 385 | name = Release; 386 | }; 387 | 817A9A07209403130059B6B9 /* Debug */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 8D316A2C849BA17876C8F3EF /* Pods-Example.debug.xcconfig */; 390 | buildSettings = { 391 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 392 | CLANG_ENABLE_MODULES = YES; 393 | CODE_SIGN_STYLE = Automatic; 394 | DEVELOPMENT_TEAM = Y2CB4K2X2B; 395 | INFOPLIST_FILE = Example/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = ( 397 | "$(inherited)", 398 | "@executable_path/Frameworks", 399 | ); 400 | PRODUCT_BUNDLE_IDENTIFIER = com.curtisherbert.loggingexample; 401 | PRODUCT_NAME = "$(TARGET_NAME)"; 402 | SWIFT_OBJC_BRIDGING_HEADER = "Example/Example-Bridging-Header.h"; 403 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 404 | SWIFT_VERSION = 4.0; 405 | TARGETED_DEVICE_FAMILY = "1,2"; 406 | }; 407 | name = Debug; 408 | }; 409 | 817A9A08209403130059B6B9 /* Release */ = { 410 | isa = XCBuildConfiguration; 411 | baseConfigurationReference = A5DD6C1E73802834320CD286 /* Pods-Example.release.xcconfig */; 412 | buildSettings = { 413 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 414 | CLANG_ENABLE_MODULES = YES; 415 | CODE_SIGN_STYLE = Automatic; 416 | DEVELOPMENT_TEAM = Y2CB4K2X2B; 417 | INFOPLIST_FILE = Example/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = ( 419 | "$(inherited)", 420 | "@executable_path/Frameworks", 421 | ); 422 | PRODUCT_BUNDLE_IDENTIFIER = com.curtisherbert.loggingexample; 423 | PRODUCT_NAME = "$(TARGET_NAME)"; 424 | SWIFT_OBJC_BRIDGING_HEADER = "Example/Example-Bridging-Header.h"; 425 | SWIFT_VERSION = 4.0; 426 | TARGETED_DEVICE_FAMILY = "1,2"; 427 | }; 428 | name = Release; 429 | }; 430 | /* End XCBuildConfiguration section */ 431 | 432 | /* Begin XCConfigurationList section */ 433 | 817A99EB209403110059B6B9 /* Build configuration list for PBXProject "Example" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | 817A9A04209403130059B6B9 /* Debug */, 437 | 817A9A05209403130059B6B9 /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | 817A9A06209403130059B6B9 /* Build configuration list for PBXNativeTarget "Example" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | 817A9A07209403130059B6B9 /* Debug */, 446 | 817A9A08209403130059B6B9 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | /* End XCConfigurationList section */ 452 | }; 453 | rootObject = 817A99E8209403110059B6B9 /* Project object */; 454 | } 455 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example.xcodeproj/project.xcworkspace/xcuserdata/parrots.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parrots/CocoaLumberjackDemo/28d0b688a82240da8b14abe19eaa0d985953537b/Example.xcodeproj/project.xcworkspace/xcuserdata/parrots.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example.xcodeproj/xcuserdata/parrots.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Example.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example.xcworkspace/xcuserdata/parrots.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parrots/CocoaLumberjackDemo/28d0b688a82240da8b14abe19eaa0d985953537b/Example.xcworkspace/xcuserdata/parrots.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Example.xcworkspace/xcuserdata/parrots.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Example 4 | // 5 | // Created by Curtis Herbert on 4/27/18. 6 | // Copyright © 2018 Curtis Herbert. 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 | -------------------------------------------------------------------------------- /Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Example 4 | // 5 | // Created by Curtis Herbert on 4/27/18. 6 | // Copyright © 2018 Curtis Herbert. All rights reserved. 7 | // 8 | 9 | @import CocoaLumberjack; 10 | #import "AppDelegate.h" 11 | #import "CrashlyticsLogger.h" 12 | #import "Logging.h" 13 | #import "Example-Swift.h" 14 | 15 | @interface AppDelegate () 16 | 17 | @end 18 | 19 | @implementation AppDelegate 20 | 21 | - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions 22 | { 23 | [self initializeLogging]; 24 | 25 | return YES; 26 | } 27 | 28 | - (void)initializeLogging 29 | { 30 | #ifdef DEBUG 31 | //if we are debugging, make sure we get the normal Xcode console logs 32 | DDTTYLogger *ttyLogger = [DDTTYLogger sharedInstance]; 33 | [DDLog addLogger:ttyLogger]; 34 | #else 35 | //if we are in the App Store or Test Flight, we want to make sure crashlytics gets the logs 36 | CrashlyticsLogger *crashlyticsLogger = [CrashlyticsLogger sharedInstance]; 37 | [DDLog addLogger:crashlyticsLogger]; 38 | 39 | //and also log to the normal system output log 40 | DDASLLogger *aslLogger = [DDASLLogger sharedInstance]; 41 | [DDLog addLogger:aslLogger]; 42 | #endif 43 | 44 | //regardless, always log to some files on the disk, to persist logs in between runs 45 | DDFileLogger* fileLogger = [[DDFileLogger alloc] init]; 46 | fileLogger.rollingFrequency = 60 * 60 * 24 * 7; //one week worth of logs will be kept 47 | fileLogger.logFileManager.maximumNumberOfLogFiles = 5; 48 | [DDLog addLogger:fileLogger]; 49 | 50 | id logger __unused = [[LogInitializer alloc] init]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Example/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 | } -------------------------------------------------------------------------------- /Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/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 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/Example-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /Example/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 | -------------------------------------------------------------------------------- /Example/LogInitializer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import CocoaLumberjack 3 | 4 | // This class is used to check the Swift flags (check "Other Swift Flags" in the build settings, you need to add -DDEBUG and -DRELEASE to your own project so you can detect if this is debug or release mode). 5 | // This makes sure that in Swift we don't waste time printing out debug-level statements when we are in release mode 6 | // Change defaultDebugLevel to suit your needs (and update Logging.h too) 7 | 8 | class LogInitializer: NSObject { 9 | override init() { 10 | super.init() 11 | #if DEBUG 12 | defaultDebugLevel = DDLogLevel.verbose 13 | #else 14 | defaultDebugLevel = DDLogLevel.info 15 | #endif 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Logging.h: -------------------------------------------------------------------------------- 1 | @import CocoaLumberjack; 2 | 3 | // This class is used to existing ObjC compiler flags to detect if we are in debug or release mode. 4 | // This makes sure that in ObjC we don't waste time printing out debug-level statements when we are in release mode 5 | // Change ddLogLevel to suit your needs (and update LogInitializer.swift too) 6 | 7 | #ifdef DEBUG 8 | static const int ddLogLevel = DDLogLevelVerbose; 9 | #else 10 | static const int ddLogLevel = DDLogLevelInfo; 11 | #endif 12 | -------------------------------------------------------------------------------- /Example/MFMailComposeViewController+Feedback.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | @import MessageUI; 3 | 4 | // this is a simple helper category to give me a reusable way to trigger the attachments needed when I want someone to send me feedback and include the relevent log data and also some helpful debug info as attachments. 5 | 6 | @interface MFMailComposeViewController (Feedback) 7 | 8 | + (instancetype)mailControllerUsingFeedbackTemplate:(NSString *)subjectTemplate; 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Example/MFMailComposeViewController+Feedback.m: -------------------------------------------------------------------------------- 1 | @import CocoaLumberjack; 2 | 3 | #import "MFMailComposeViewController+Feedback.h" 4 | #import "Example-Swift.h" 5 | #import 6 | 7 | @implementation MFMailComposeViewController (Feedback) 8 | 9 | + (instancetype)mailControllerUsingFeedbackTemplate:(NSString *)subjectTemplate 10 | { 11 | NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; 12 | MFMailComposeViewController *mailComposeVC = [[MFMailComposeViewController alloc] init]; 13 | [mailComposeVC setSubject:[NSString stringWithFormat:subjectTemplate, appVersion]]; 14 | [mailComposeVC setToRecipients:@[@"hello@getslopes.com"]]; 15 | NSMutableData *errorLogData = [NSMutableData data]; 16 | 17 | //get error log data by inspecting CocoaLumberjack for the file-based logger (which should always be there) 18 | DDFileLogger *fileLogger; 19 | for (id logger in DDLog.allLoggers) { 20 | if ([logger isKindOfClass:[DDFileLogger class]]) { 21 | fileLogger = logger; 22 | break; 23 | } 24 | } 25 | 26 | //we want to go through all the logs, read them, and combine them into one long string that we can email as a text file 27 | NSUInteger maximumLogFilesToReturn = MIN(fileLogger.logFileManager.maximumNumberOfLogFiles, 10); 28 | NSMutableArray *errorLogFiles = [NSMutableArray arrayWithCapacity:maximumLogFilesToReturn]; 29 | NSArray *sortedLogFileInfos = [fileLogger.logFileManager sortedLogFileInfos]; 30 | for (NSInteger i = MIN(sortedLogFileInfos.count, maximumLogFilesToReturn) - 1; i >= 0; i--) { 31 | DDLogFileInfo *logFileInfo = [sortedLogFileInfos objectAtIndex:i]; 32 | NSData *fileData = [NSData dataWithContentsOfFile:logFileInfo.filePath]; 33 | [errorLogFiles addObject:fileData]; 34 | } 35 | 36 | for (NSData *errorLogFileData in errorLogFiles) { 37 | [errorLogData appendData:errorLogFileData]; 38 | } 39 | [mailComposeVC addAttachmentData:errorLogData mimeType:@"text/plain" fileName:@"ErrorLog.txt"]; 40 | 41 | //lets add a debug text file with useful information we can use to help the customer 42 | 43 | NSString *osVersion = [[UIDevice currentDevice] systemVersion]; 44 | NSMutableString *debugInfo = [[NSMutableString alloc] init]; 45 | [debugInfo appendFormat:@"iOS Version: %@\n", osVersion]; 46 | struct utsname systemInfo; 47 | uname(&systemInfo); 48 | [debugInfo appendFormat:@"Device: %@\n", [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]]; 49 | [debugInfo appendFormat:@"App Version: %@\n", appVersion]; 50 | 51 | //I commented the below out, but you can see how I'm including CoreLocation permissions, HealthKit permissions, etc in this text attachment 52 | 53 | // [debugInfo appendFormat:@"Sync Device ID: %@\n", SlopesSyncManager.sharedInstance.deviceID]; 54 | // [debugInfo appendFormat:@"Apple Watch Paired: %@\n", [WCSession defaultSession].isPaired ? @"Yes" : @"No"]; 55 | // [debugInfo appendFormat:@"Apple Watch App Installed: %@\n", [WCSession defaultSession].isWatchAppInstalled ? @"Yes" : @"No"]; 56 | // [debugInfo appendFormat:@"Apple Watch Complication Enabled: %@\n", [WCSession defaultSession].isComplicationEnabled ? @"Yes" : @"No"]; 57 | // switch ([CLLocationManager authorizationStatus]) { 58 | // case kCLAuthorizationStatusAuthorizedWhenInUse: 59 | // [debugInfo appendString:@"Location Permission: When in Use\n"]; 60 | // break; 61 | // case kCLAuthorizationStatusAuthorizedAlways: 62 | // [debugInfo appendString:@"Location Permission: Always\n"]; 63 | // break; 64 | // case kCLAuthorizationStatusNotDetermined: 65 | // [debugInfo appendString:@"Location Permission: Not Determined\n"]; 66 | // break; 67 | // case kCLAuthorizationStatusDenied: 68 | // [debugInfo appendString:@"Location Permission: Denied\n"]; 69 | // break; 70 | // case kCLAuthorizationStatusRestricted: 71 | // [debugInfo appendString:@"Location Permission: Restricted\n"]; 72 | // break; 73 | // } 74 | // switch ([PHPhotoLibrary authorizationStatus]) { 75 | // case PHAuthorizationStatusAuthorized: 76 | // [debugInfo appendString:@"Photo Permission: Authorized\n"]; 77 | // break; 78 | // case PHAuthorizationStatusNotDetermined: 79 | // [debugInfo appendString:@"Photo Permission: Not Determined\n"]; 80 | // break; 81 | // case PHAuthorizationStatusDenied: 82 | // [debugInfo appendString:@"Photo Permission: Denied\n"]; 83 | // break; 84 | // case PHAuthorizationStatusRestricted: 85 | // [debugInfo appendString:@"Photo Permission: Restricted\n"]; 86 | // break; 87 | // } 88 | // HKHealthStore *store = [[HKHealthStore alloc] init]; 89 | // if (HKHealthStore.isHealthDataAvailable) { 90 | // NSArray *writeTypes = @[[HKWorkoutType workoutType], [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned]]; 91 | // if (@available(iOS 11.2, *)) { 92 | // writeTypes = [writeTypes arrayByAddingObject:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceDownhillSnowSports]]; 93 | // } 94 | // for (HKSampleType *type in writeTypes) { 95 | // [debugInfo appendFormat:@"%@ write: %@\n", NSStringFromClass([type class]), [store authorizationStatusForType:type] == HKAuthorizationStatusSharingAuthorized ? @"Yes" : @"No"]; 96 | // } 97 | // [debugInfo appendFormat:@"HK DownhillSports Share: %@\n", [WCSession defaultSession].isPaired ? @"Yes" : @"No"]; 98 | // } 99 | 100 | [mailComposeVC addAttachmentData:[debugInfo dataUsingEncoding:NSUTF8StringEncoding] mimeType:@"text/plain" fileName:@"DebugInfo.txt"]; 101 | 102 | return mailComposeVC; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /Example/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Example 4 | // 5 | // Created by Curtis Herbert on 4/27/18. 6 | // Copyright © 2018 Curtis Herbert. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | - (IBAction)sendFeedback:(id)sender; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Example/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Example 4 | // 5 | // Created by Curtis Herbert on 4/27/18. 6 | // Copyright © 2018 Curtis Herbert. All rights reserved. 7 | // 8 | 9 | @import MessageUI; 10 | @import CocoaLumberjack; 11 | #import "ViewController.h" 12 | #import "MFMailComposeViewController+Feedback.h" 13 | #import "Logging.h" 14 | 15 | @interface ViewController () 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad 22 | { 23 | [super viewDidLoad]; 24 | 25 | //in order of severity. Change Logging.h and LogInitializer.swift to tweak which of these show up for the App Store 26 | //the beauty of CocoaLumberjack is you can leave debug messages in and they just get ignored for the app store. 27 | DDLogVerbose(@"This is an example of a log that will only be seen when doing a Build->Run. App Store won't log this"); 28 | DDLogDebug(@"This is an example of a log that will only be seen when doing a Build->Run. App Store won't log this"); 29 | DDLogInfo(@"This is an example of a log that will show up always"); 30 | DDLogWarn(@"This is an example of a log that will show up always"); 31 | DDLogError(@"This is an example of a log that will show up always"); 32 | } 33 | 34 | //I did't hook up a button to trigger this, but use your imagination ;) 35 | - (IBAction)sendFeedback:(id)sender 36 | { 37 | if ([MFMailComposeViewController canSendMail]){ 38 | MFMailComposeViewController *mailComposeVC = [MFMailComposeViewController mailControllerUsingFeedbackTemplate:@"Feedback for Version %@"]; 39 | mailComposeVC.mailComposeDelegate = self; 40 | [self presentViewController:mailComposeVC animated:true completion:nil]; 41 | 42 | } else { 43 | UIAlertController *mailAlertController = [UIAlertController alertControllerWithTitle:@"Can't send feedback" message:@"You don't have a mail account set up on this device. You can get in touch at hello@getslopes.com." preferredStyle:UIAlertControllerStyleAlert]; 44 | UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; 45 | [mailAlertController addAction:okAction]; 46 | [self presentViewController:mailAlertController animated:YES completion:nil]; 47 | } 48 | } 49 | 50 | #pragma mark - MFMailComposeViewController delegate 51 | 52 | - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error 53 | { 54 | [controller dismissViewControllerAnimated:YES completion:^{ }]; 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Example 4 | // 5 | // Created by Curtis Herbert on 4/27/18. 6 | // Copyright © 2018 Curtis Herbert. 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | workspace 'Example.xcworkspace' 2 | 3 | use_frameworks! 4 | 5 | target 'Example' do 6 | platform :ios, '10.0' 7 | project 'Example.xcodeproj' 8 | inhibit_all_warnings! 9 | pod 'CocoaLumberjack' 10 | pod 'CocoaLumberjack/Swift' 11 | pod 'Crashlytics' 12 | end 13 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack (3.4.2): 3 | - CocoaLumberjack/Default (= 3.4.2) 4 | - CocoaLumberjack/Extensions (= 3.4.2) 5 | - CocoaLumberjack/Default (3.4.2) 6 | - CocoaLumberjack/Extensions (3.4.2): 7 | - CocoaLumberjack/Default 8 | - CocoaLumberjack/Swift (3.4.2): 9 | - CocoaLumberjack/Default 10 | - Crashlytics (3.10.1): 11 | - Fabric (~> 1.7.5) 12 | - Fabric (1.7.6) 13 | 14 | DEPENDENCIES: 15 | - CocoaLumberjack 16 | - CocoaLumberjack/Swift 17 | - Crashlytics 18 | 19 | SPEC REPOS: 20 | https://github.com/CocoaPods/Specs.git: 21 | - CocoaLumberjack 22 | - Crashlytics 23 | - Fabric 24 | 25 | SPEC CHECKSUMS: 26 | CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd 27 | Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff 28 | Fabric: f8d42c893bb187326a7968b62abe55c36a987a46 29 | 30 | PODFILE CHECKSUM: 8a55fefb9277385b9c640f5dce9411beabffcb8d 31 | 32 | COCOAPODS: 1.5.0 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CocoaLumberjackDemo 2 | A sample of my default setup for CocoaLumberjack 3 | 4 | ## To Run the Demo 5 | CD into the root of this example and run `pod install` from your terminal. Don't have CocoaPods installed? Follow their [Getting Started](https://guides.cocoapods.org/using/getting-started.html) guide. -------------------------------------------------------------------------------- /Vendor/CrashlyticsLumberjack/CrashlyticsLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // CrashlyticsLogger.h 3 | // 4 | // Created by Simons, Mike on 5/16/13. 5 | // Copyright (c) 2013 TechSmith. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface CrashlyticsLogger : DDAbstractLogger 11 | 12 | +(CrashlyticsLogger*) sharedInstance; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Vendor/CrashlyticsLumberjack/CrashlyticsLogger.m: -------------------------------------------------------------------------------- 1 | // 2 | // CrashlyticsLogger.m 3 | // 4 | // Created by Simons, Mike on 5/16/13. 5 | // Copyright (c) 2013 TechSmith. All rights reserved. 6 | // 7 | 8 | #import "CrashlyticsLogger.h" 9 | 10 | OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); 11 | 12 | @implementation CrashlyticsLogger 13 | 14 | -(void) logMessage:(DDLogMessage *)logMessage 15 | { 16 | NSString *logMsg = logMessage->_message; 17 | 18 | if (_logFormatter) 19 | { 20 | logMsg = [_logFormatter formatLogMessage:logMessage]; 21 | } 22 | 23 | if (logMsg) 24 | { 25 | CLSLog(@"%@",logMsg); 26 | } 27 | } 28 | 29 | 30 | +(CrashlyticsLogger*) sharedInstance 31 | { 32 | static dispatch_once_t pred = 0; 33 | static CrashlyticsLogger *_sharedInstance = nil; 34 | 35 | dispatch_once(&pred, ^{ 36 | _sharedInstance = [[self alloc] init]; 37 | }); 38 | 39 | return _sharedInstance; 40 | } 41 | 42 | @end 43 | --------------------------------------------------------------------------------