├── .gitignore ├── .gitmodules ├── DebugLog.all.swift ├── DebugLog ├── DDFileReader+DebugLog.swift ├── DebugLog+ClassParsing.swift ├── DebugLog+Printable.swift └── DebugLog.swift ├── Demo ├── DebugLogDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── Debug.xcscheme │ │ └── Release.xcscheme ├── DebugLogDemo │ ├── AppDelegate.swift │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ └── Info.plist └── DebugLogDemoTests │ ├── DebugLogDemoTests.swift │ └── Info.plist ├── LICENSE ├── README.md └── Scripts └── concat.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # CocoaPods 2 | # 3 | # We recommend against adding the Pods directory to your .gitignore. However 4 | # you should judge for yourself, the pros and cons are mentioned at: 5 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control? 6 | # 7 | # Pods/ 8 | 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Vendor/DDFileReader"] 2 | path = Vendor/DDFileReader 3 | url = https://github.com/inamiy/DDFileReader.git 4 | -------------------------------------------------------------------------------- /DebugLog.all.swift: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // DDFileReader+DebugLog.swift 4 | // DebugLog 5 | // 6 | // Created by Yasuhiro Inami on 2014/06/26. 7 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 8 | // 9 | 10 | import Foundation 11 | 12 | extension DDFileReader 13 | { 14 | func readLogLine(index: Int) -> NSString! 15 | { 16 | var line: NSString! 17 | 18 | self.resetOffset() 19 | 20 | var lineNum = 0 21 | 22 | self.enumerateLinesUsingBlock { (currentLine, stop) in 23 | lineNum += 1 24 | if lineNum == index { 25 | line = currentLine 26 | stop = true 27 | } 28 | } 29 | 30 | let logFuncString = "LOG_OBJECT\\(.*?\\)" as NSString 31 | 32 | var range = line.rangeOfString(logFuncString as String, options: .RegularExpressionSearch) 33 | range.location += logFuncString.length-6 34 | range.length -= logFuncString.length-5 35 | 36 | line = line.substringWithRange(range).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 37 | return line 38 | } 39 | } 40 | 41 | // 42 | // DebugLog+ClassParsing.swift 43 | // DebugLog 44 | // 45 | // Created by Yasuhiro Inami on 2014/06/26. 46 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 47 | // 48 | 49 | import Foundation 50 | 51 | // Swift and Objective-C Class Parsing by @jpsim 52 | // https://gist.github.com/jpsim/1b86d116808cb4e9bc30 53 | extension DebugLog 54 | { 55 | enum ClassType { 56 | case Swift, ObjectiveC 57 | 58 | func toString() -> String { 59 | switch self { 60 | case .Swift: 61 | return "Swift" 62 | case .ObjectiveC: 63 | return "Objective-C" 64 | } 65 | } 66 | } 67 | 68 | struct ParsedClass { 69 | let type: ClassType 70 | let name: String 71 | 72 | let mangledName: String? 73 | let moduleName: String? 74 | } 75 | 76 | static func _substr(str: String, range: Range) -> String { 77 | let startIndex = str.startIndex.advancedBy(range.startIndex) 78 | let endIndex = startIndex.advancedBy(range.endIndex) 79 | 80 | return str[startIndex.. ParsedClass { 84 | // Swift mangling details found here: http://www.eswick.com/2014/06/inside-swift 85 | 86 | let originalName = NSStringFromClass(aClass) 87 | 88 | if !originalName.hasPrefix("_T") { 89 | // Not a Swift symbol 90 | return ParsedClass(type: ClassType.ObjectiveC, 91 | name: originalName, 92 | mangledName: nil, 93 | moduleName: nil) 94 | } 95 | 96 | let originalNameLength = originalName.utf16.count 97 | var cursor = 4 98 | var substring = _substr(originalName, range: cursor ..< originalNameLength-cursor) 99 | 100 | // Module 101 | let moduleLength = (substring as NSString).integerValue 102 | let moduleLengthLength = "\(moduleLength)".utf16.count 103 | let moduleName = _substr(substring, range: moduleLengthLength ..< moduleLength) 104 | 105 | // Update cursor and substring 106 | cursor += moduleLengthLength + moduleName.utf16.count 107 | substring = _substr(originalName, range: cursor ..< originalNameLength-cursor) 108 | 109 | // Class name 110 | let classLength = (substring as NSString).integerValue 111 | let classLengthLength = "\(classLength)".utf16.count 112 | let className = _substr(substring, range: classLengthLength ..< classLength) 113 | 114 | return ParsedClass(type: ClassType.Swift, 115 | name: className, 116 | mangledName: originalName, 117 | moduleName: moduleName) 118 | } 119 | 120 | } 121 | 122 | // 123 | // DebugLog+Printable.swift 124 | // DebugLog 125 | // 126 | // Created by Yasuhiro Inami on 2014/06/22. 127 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 128 | // 129 | 130 | import Foundation 131 | import CoreGraphics 132 | import QuartzCore 133 | 134 | // 135 | // TODO: 136 | // Some C-structs (e.g. CGAffineTransform, CATransform3D) + Printable don't work well in Xcode6-beta2 137 | // 138 | extension CGAffineTransform : CustomStringConvertible, CustomDebugStringConvertible 139 | { 140 | public var description: String 141 | { 142 | // return NSStringFromCGAffineTransform(self) // comment-out: requires UIKit 143 | return "[\(a), \(b);\n \(c), \(d);\n \(tx), \(ty)]" 144 | } 145 | 146 | public var debugDescription: String 147 | { 148 | return self.description 149 | } 150 | } 151 | 152 | extension CATransform3D : CustomStringConvertible, CustomDebugStringConvertible 153 | { 154 | public var description: String 155 | { 156 | return "[\(m11) \(m12) \(m13) \(m14);\n \(m21) \(m22) \(m23) \(m24);\n \(m31) \(m32) \(m33) \(m34);\n \(m41) \(m42) \(m43) \(m44)]" 157 | } 158 | 159 | public var debugDescription: String 160 | { 161 | return self.description 162 | } 163 | } 164 | 165 | // 166 | // DebugLog.swift 167 | // DebugLog 168 | // 169 | // Created by Yasuhiro Inami on 2014/06/22. 170 | // Copyright (c) 2014年 Inami Yasuhiro. All rights reserved. 171 | // 172 | 173 | import Foundation 174 | 175 | public struct DebugLog 176 | { 177 | private static let _lock = NSObject() 178 | 179 | private static let _dateFormatter: NSDateFormatter = { 180 | let formatter = NSDateFormatter() 181 | formatter.locale = NSLocale.currentLocale() 182 | formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" 183 | return formatter 184 | }() 185 | 186 | private static func _currentDateString() -> String 187 | { 188 | return self._dateFormatter.stringFromDate(NSDate()) 189 | } 190 | 191 | public static var printHandler: (Any!, String, String, Int) -> Void = { body, filename, functionName, line in 192 | 193 | let dateString = DebugLog._currentDateString() 194 | 195 | if body == nil { 196 | print("\(dateString) [\(filename).\(functionName):\(line)]") // print functionName 197 | return 198 | } 199 | 200 | if let body = body as? String { 201 | if body.characters.count == 0 { 202 | print("") // print break 203 | return 204 | } 205 | } 206 | 207 | print("\(dateString) [\(filename):\(line)] \(body)") 208 | } 209 | 210 | public static func print(body: Any! = nil, filename: String = #file, functionName: String = #function, line: Int = #line) 211 | { 212 | #if DEBUG 213 | 214 | objc_sync_enter(_lock) 215 | 216 | self.printHandler( 217 | body, 218 | ((filename as NSString).lastPathComponent as NSString).stringByDeletingPathExtension, 219 | functionName, 220 | line 221 | ) 222 | 223 | objc_sync_exit(_lock) 224 | 225 | #endif 226 | } 227 | } 228 | 229 | /// LOG() = prints __FUNCTION__ 230 | public func LOG(filename: String = #file, functionName: String = #function, line: Int = #line) 231 | { 232 | #if DEBUG 233 | 234 | DebugLog.print(nil, filename: filename, functionName: functionName, line: line) 235 | 236 | #endif 237 | } 238 | 239 | /// LOG(...) = println 240 | public func LOG(body: Any, filename: String = #file, functionName: String = #function, line: Int = #line) 241 | { 242 | #if DEBUG 243 | 244 | DebugLog.print(body, filename: filename, functionName: functionName, line: line) 245 | 246 | #endif 247 | } 248 | 249 | /// LOG_OBJECT(myObject) = println("myObject = ...") 250 | public func LOG_OBJECT(body: Any, filename: String = #file, functionName: String = #function, line: Int = #line) 251 | { 252 | #if DEBUG 253 | 254 | if let reader = DDFileReader(filePath: filename) { 255 | let logBody = "\(reader.readLogLine(line)) = \(body)" 256 | 257 | LOG(logBody, filename: filename, functionName: functionName, line: line) 258 | } else { 259 | LOG(body, filename: filename, functionName: functionName, line: line) 260 | } 261 | 262 | #endif 263 | } 264 | 265 | public func LOG_OBJECT(body: AnyClass, filename: String = #file, functionName: String = #function, line: Int = #line) 266 | { 267 | #if DEBUG 268 | 269 | _ = DDFileReader(filePath: filename) 270 | 271 | let classInfo: DebugLog.ParsedClass = DebugLog.parseClass(body) 272 | let classString = classInfo.moduleName != nil ? "\(classInfo.moduleName!).\(classInfo.name)" : "\(classInfo.name)" 273 | 274 | LOG_OBJECT(classString, filename: filename, functionName: functionName, line: line) 275 | 276 | // comment-out: requires method name demangling 277 | // LOG_OBJECT("\(class_getName(body))", filename: filename, functionName: functionName, line: line) 278 | 279 | #endif 280 | } 281 | 282 | 283 | // 284 | // DDFileReader.swift 285 | // DDFileReader 286 | // 287 | // Created by Yasuhiro Inami on 2014/06/22. 288 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 289 | // 290 | 291 | import Foundation 292 | 293 | // 294 | // Swift port of DDFileReader by Dave DeLong 295 | // 296 | // objective c - How to read data from NSFileHandle line by line? - Stack Overflow 297 | // http://stackoverflow.com/a/3711079/666371 298 | // 299 | public class DDFileReader 300 | { 301 | public var lineDelimiter = "\n" 302 | public var chunkSize = 128 303 | 304 | public let filePath: NSString 305 | 306 | private let _fileHandle: NSFileHandle! 307 | private let _totalFileLength: CUnsignedLongLong 308 | private var _currentOffset: CUnsignedLongLong = 0 309 | 310 | public init?(filePath: NSString) 311 | { 312 | self.filePath = filePath 313 | if let fileHandle = NSFileHandle(forReadingAtPath: filePath as String) { 314 | self._fileHandle = fileHandle 315 | self._totalFileLength = self._fileHandle.seekToEndOfFile() 316 | } 317 | else { 318 | self._fileHandle = nil 319 | self._totalFileLength = 0 320 | 321 | return nil 322 | } 323 | } 324 | 325 | deinit 326 | { 327 | if let _fileHandle = self._fileHandle { 328 | _fileHandle.closeFile() 329 | } 330 | } 331 | 332 | public func readLine() -> NSString? 333 | { 334 | if self._currentOffset >= self._totalFileLength { 335 | return nil 336 | } 337 | 338 | self._fileHandle.seekToFileOffset(self._currentOffset) 339 | let newLineData = self.lineDelimiter.dataUsingEncoding(NSUTF8StringEncoding) 340 | let currentData = NSMutableData() 341 | var shouldReadMore = true 342 | 343 | autoreleasepool { 344 | 345 | while shouldReadMore { 346 | 347 | if self._currentOffset >= self._totalFileLength { 348 | break 349 | } 350 | 351 | var chunk = self._fileHandle.readDataOfLength(self.chunkSize) 352 | 353 | let newLineRange = chunk.rangeOfData(newLineData!) 354 | 355 | if newLineRange.location != NSNotFound { 356 | chunk = chunk.subdataWithRange(NSMakeRange(0, newLineRange.location+newLineData!.length)) 357 | shouldReadMore = false 358 | } 359 | currentData.appendData(chunk) 360 | 361 | self._currentOffset += CUnsignedLongLong(chunk.length) 362 | 363 | } 364 | 365 | } 366 | 367 | let line = NSString(data: currentData, encoding:NSUTF8StringEncoding) 368 | 369 | return line 370 | } 371 | 372 | public func readTrimmedLine() -> NSString? 373 | { 374 | let characterSet = NSCharacterSet(charactersInString: self.lineDelimiter) 375 | return self.readLine()?.stringByTrimmingCharactersInSet(characterSet) 376 | } 377 | 378 | public func enumerateLinesUsingBlock(closure: (line: NSString, stop: inout Bool) -> Void) 379 | { 380 | var line: NSString? = nil 381 | var stop = false 382 | while stop == false { 383 | line = self.readLine() 384 | if line == nil { break } 385 | 386 | closure(line: line!, stop: &stop) 387 | } 388 | } 389 | 390 | public func resetOffset() 391 | { 392 | self._currentOffset = 0 393 | } 394 | } 395 | 396 | extension NSData 397 | { 398 | private func rangeOfData(dataToFind: NSData) -> NSRange 399 | { 400 | var searchIndex = 0 401 | var foundRange = NSRange(location: NSNotFound, length: dataToFind.length) 402 | 403 | for index in 0...length-1 { 404 | 405 | let bytes_ = UnsafeBufferPointer(start: UnsafePointer(self.bytes), count: self.length) 406 | let searchBytes_ = UnsafeBufferPointer(start: UnsafePointer(dataToFind.bytes), count: self.length) 407 | 408 | if bytes_[index] == searchBytes_[searchIndex] { 409 | if foundRange.location == NSNotFound { 410 | foundRange.location = index 411 | } 412 | searchIndex += 1 413 | if searchIndex >= dataToFind.length { 414 | return foundRange 415 | } 416 | } 417 | else { 418 | searchIndex = 0 419 | foundRange.location = NSNotFound 420 | } 421 | 422 | } 423 | return foundRange 424 | } 425 | } 426 | -------------------------------------------------------------------------------- /DebugLog/DDFileReader+DebugLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DDFileReader+DebugLog.swift 3 | // DebugLog 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/26. 6 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension DDFileReader 12 | { 13 | func readLogLine(index: Int) -> NSString! 14 | { 15 | var line: NSString! 16 | 17 | self.resetOffset() 18 | 19 | var lineNum = 0 20 | 21 | self.enumerateLinesUsingBlock { (currentLine, stop) in 22 | lineNum += 1 23 | if lineNum == index { 24 | line = currentLine 25 | stop = true 26 | } 27 | } 28 | 29 | let logFuncString = "LOG_OBJECT\\(.*?\\)" as NSString 30 | 31 | var range = line.rangeOfString(logFuncString as String, options: .RegularExpressionSearch) 32 | range.location += logFuncString.length-6 33 | range.length -= logFuncString.length-5 34 | 35 | line = line.substringWithRange(range).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 36 | return line 37 | } 38 | } -------------------------------------------------------------------------------- /DebugLog/DebugLog+ClassParsing.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DebugLog+ClassParsing.swift 3 | // DebugLog 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/26. 6 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // Swift and Objective-C Class Parsing by @jpsim 12 | // https://gist.github.com/jpsim/1b86d116808cb4e9bc30 13 | extension DebugLog 14 | { 15 | enum ClassType { 16 | case Swift, ObjectiveC 17 | 18 | func toString() -> String { 19 | switch self { 20 | case .Swift: 21 | return "Swift" 22 | case .ObjectiveC: 23 | return "Objective-C" 24 | } 25 | } 26 | } 27 | 28 | struct ParsedClass { 29 | let type: ClassType 30 | let name: String 31 | 32 | let mangledName: String? 33 | let moduleName: String? 34 | } 35 | 36 | static func _substr(str: String, range: Range) -> String { 37 | let startIndex = str.startIndex.advancedBy(range.startIndex) 38 | let endIndex = startIndex.advancedBy(range.endIndex) 39 | 40 | return str[startIndex.. ParsedClass { 44 | // Swift mangling details found here: http://www.eswick.com/2014/06/inside-swift 45 | 46 | let originalName = NSStringFromClass(aClass) 47 | 48 | if !originalName.hasPrefix("_T") { 49 | // Not a Swift symbol 50 | return ParsedClass(type: ClassType.ObjectiveC, 51 | name: originalName, 52 | mangledName: nil, 53 | moduleName: nil) 54 | } 55 | 56 | let originalNameLength = originalName.utf16.count 57 | var cursor = 4 58 | var substring = _substr(originalName, range: cursor ..< originalNameLength-cursor) 59 | 60 | // Module 61 | let moduleLength = (substring as NSString).integerValue 62 | let moduleLengthLength = "\(moduleLength)".utf16.count 63 | let moduleName = _substr(substring, range: moduleLengthLength ..< moduleLength) 64 | 65 | // Update cursor and substring 66 | cursor += moduleLengthLength + moduleName.utf16.count 67 | substring = _substr(originalName, range: cursor ..< originalNameLength-cursor) 68 | 69 | // Class name 70 | let classLength = (substring as NSString).integerValue 71 | let classLengthLength = "\(classLength)".utf16.count 72 | let className = _substr(substring, range: classLengthLength ..< classLength) 73 | 74 | return ParsedClass(type: ClassType.Swift, 75 | name: className, 76 | mangledName: originalName, 77 | moduleName: moduleName) 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /DebugLog/DebugLog+Printable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DebugLog+Printable.swift 3 | // DebugLog 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/22. 6 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreGraphics 11 | import QuartzCore 12 | 13 | // 14 | // TODO: 15 | // Some C-structs (e.g. CGAffineTransform, CATransform3D) + Printable don't work well in Xcode6-beta2 16 | // 17 | extension CGAffineTransform : CustomStringConvertible, CustomDebugStringConvertible 18 | { 19 | public var description: String 20 | { 21 | // return NSStringFromCGAffineTransform(self) // comment-out: requires UIKit 22 | return "[\(a), \(b);\n \(c), \(d);\n \(tx), \(ty)]" 23 | } 24 | 25 | public var debugDescription: String 26 | { 27 | return self.description 28 | } 29 | } 30 | 31 | extension CATransform3D : CustomStringConvertible, CustomDebugStringConvertible 32 | { 33 | public var description: String 34 | { 35 | return "[\(m11) \(m12) \(m13) \(m14);\n \(m21) \(m22) \(m23) \(m24);\n \(m31) \(m32) \(m33) \(m34);\n \(m41) \(m42) \(m43) \(m44)]" 36 | } 37 | 38 | public var debugDescription: String 39 | { 40 | return self.description 41 | } 42 | } -------------------------------------------------------------------------------- /DebugLog/DebugLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DebugLog.swift 3 | // DebugLog 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/22. 6 | // Copyright (c) 2014年 Inami Yasuhiro. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public struct DebugLog 12 | { 13 | private static let _lock = NSObject() 14 | 15 | private static let _dateFormatter: NSDateFormatter = { 16 | let formatter = NSDateFormatter() 17 | formatter.locale = NSLocale.currentLocale() 18 | formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" 19 | return formatter 20 | }() 21 | 22 | private static func _currentDateString() -> String 23 | { 24 | return self._dateFormatter.stringFromDate(NSDate()) 25 | } 26 | 27 | public static var printHandler: (Any!, String, String, Int) -> Void = { body, filename, functionName, line in 28 | 29 | let dateString = DebugLog._currentDateString() 30 | 31 | if body == nil { 32 | print("\(dateString) [\(filename).\(functionName):\(line)]") // print functionName 33 | return 34 | } 35 | 36 | if let body = body as? String { 37 | if body.characters.count == 0 { 38 | print("") // print break 39 | return 40 | } 41 | } 42 | 43 | print("\(dateString) [\(filename):\(line)] \(body)") 44 | } 45 | 46 | public static func print(body: Any! = nil, filename: String = #file, functionName: String = #function, line: Int = #line) 47 | { 48 | #if DEBUG 49 | 50 | objc_sync_enter(_lock) 51 | 52 | self.printHandler( 53 | body, 54 | ((filename as NSString).lastPathComponent as NSString).stringByDeletingPathExtension, 55 | functionName, 56 | line 57 | ) 58 | 59 | objc_sync_exit(_lock) 60 | 61 | #endif 62 | } 63 | } 64 | 65 | /// LOG() = prints __FUNCTION__ 66 | public func LOG(filename: String = #file, functionName: String = #function, line: Int = #line) 67 | { 68 | #if DEBUG 69 | 70 | DebugLog.print(nil, filename: filename, functionName: functionName, line: line) 71 | 72 | #endif 73 | } 74 | 75 | /// LOG(...) = println 76 | public func LOG(body: Any, filename: String = #file, functionName: String = #function, line: Int = #line) 77 | { 78 | #if DEBUG 79 | 80 | DebugLog.print(body, filename: filename, functionName: functionName, line: line) 81 | 82 | #endif 83 | } 84 | 85 | /// LOG_OBJECT(myObject) = println("myObject = ...") 86 | public func LOG_OBJECT(body: Any, filename: String = #file, functionName: String = #function, line: Int = #line) 87 | { 88 | #if DEBUG 89 | 90 | if let reader = DDFileReader(filePath: filename) { 91 | let logBody = "\(reader.readLogLine(line)) = \(body)" 92 | 93 | LOG(logBody, filename: filename, functionName: functionName, line: line) 94 | } else { 95 | LOG(body, filename: filename, functionName: functionName, line: line) 96 | } 97 | 98 | #endif 99 | } 100 | 101 | public func LOG_OBJECT(body: AnyClass, filename: String = #file, functionName: String = #function, line: Int = #line) 102 | { 103 | #if DEBUG 104 | 105 | _ = DDFileReader(filePath: filename) 106 | 107 | let classInfo: DebugLog.ParsedClass = DebugLog.parseClass(body) 108 | let classString = classInfo.moduleName != nil ? "\(classInfo.moduleName!).\(classInfo.name)" : "\(classInfo.name)" 109 | 110 | LOG_OBJECT(classString, filename: filename, functionName: functionName, line: line) 111 | 112 | // comment-out: requires method name demangling 113 | // LOG_OBJECT("\(class_getName(body))", filename: filename, functionName: functionName, line: line) 114 | 115 | #endif 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1FD469541957186500BC0073 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD469531957186500BC0073 /* AppDelegate.swift */; }; 11 | 1FD469561957186500BC0073 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1FD469551957186500BC0073 /* Images.xcassets */; }; 12 | 1FD469B019571E5F00BC0073 /* DebugLogDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD469AF19571E5F00BC0073 /* DebugLogDemoTests.swift */; }; 13 | 1FF59ECA1AE21A9C009C08DB /* DebugLog.all.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF59EC81AE21A9C009C08DB /* DebugLog.all.swift */; }; 14 | 1FF59ECB1AE21ADC009C08DB /* DDFileReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF59EB21AE2195C009C08DB /* DDFileReader.swift */; }; 15 | 1FF59ECC1AE21ADC009C08DB /* DebugLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD4699719571D7A00BC0073 /* DebugLog.swift */; }; 16 | 1FF59ECD1AE21ADC009C08DB /* DebugLog+Printable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FD4699619571D7A00BC0073 /* DebugLog+Printable.swift */; }; 17 | 1FF59ECE1AE21ADC009C08DB /* DebugLog+ClassParsing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FF76470195BB00800756B5E /* DebugLog+ClassParsing.swift */; }; 18 | 1FF59ECF1AE21ADC009C08DB /* DDFileReader+DebugLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F511160195BC12800A26D41 /* DDFileReader+DebugLog.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 1FD4695C1957186500BC0073 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 1FD469461957186500BC0073 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 1FD4694D1957186500BC0073; 27 | remoteInfo = DebugLogDemo; 28 | }; 29 | 1FD46977195718A300BC0073 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 1FD469461957186500BC0073 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 1FD4694D1957186500BC0073; 34 | remoteInfo = DebugLogDemo; 35 | }; 36 | 1FD46979195718A300BC0073 /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 1FD469461957186500BC0073 /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = 1FD4694D1957186500BC0073; 41 | remoteInfo = DebugLogDemo; 42 | }; 43 | 1FE18D66195BC53D00DAFE3A /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 1FD469461957186500BC0073 /* Project object */; 46 | proxyType = 1; 47 | remoteGlobalIDString = 1FD4694D1957186500BC0073; 48 | remoteInfo = DebugLogDemo; 49 | }; 50 | /* End PBXContainerItemProxy section */ 51 | 52 | /* Begin PBXFileReference section */ 53 | 1F511160195BC12800A26D41 /* DDFileReader+DebugLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DDFileReader+DebugLog.swift"; sourceTree = ""; }; 54 | 1FD4694E1957186500BC0073 /* DebugLogDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DebugLogDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 1FD469521957186500BC0073 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 1FD469531957186500BC0073 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 57 | 1FD469551957186500BC0073 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 58 | 1FD4695B1957186500BC0073 /* DebugLogDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DebugLogDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 1FD469601957186500BC0073 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 1FD4699619571D7A00BC0073 /* DebugLog+Printable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DebugLog+Printable.swift"; sourceTree = ""; }; 61 | 1FD4699719571D7A00BC0073 /* DebugLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugLog.swift; sourceTree = ""; }; 62 | 1FD469AF19571E5F00BC0073 /* DebugLogDemoTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugLogDemoTests.swift; sourceTree = ""; }; 63 | 1FF59EB21AE2195C009C08DB /* DDFileReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DDFileReader.swift; sourceTree = ""; }; 64 | 1FF59EC81AE21A9C009C08DB /* DebugLog.all.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DebugLog.all.swift; path = ../DebugLog.all.swift; sourceTree = ""; }; 65 | 1FF76470195BB00800756B5E /* DebugLog+ClassParsing.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DebugLog+ClassParsing.swift"; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 1FD4694B1957186500BC0073 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 1FD469581957186500BC0073 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | /* End PBXFrameworksBuildPhase section */ 84 | 85 | /* Begin PBXGroup section */ 86 | 1FD469451957186500BC0073 = { 87 | isa = PBXGroup; 88 | children = ( 89 | 1FF59EC81AE21A9C009C08DB /* DebugLog.all.swift */, 90 | 1FF59EAD1AE2195C009C08DB /* Vendor */, 91 | 1FD4698719571D7A00BC0073 /* DebugLog */, 92 | 1FD469501957186500BC0073 /* DebugLogDemo */, 93 | 1FD4695E1957186500BC0073 /* DebugLogDemoTests */, 94 | 1FD4694F1957186500BC0073 /* Products */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 1FD4694F1957186500BC0073 /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 1FD4694E1957186500BC0073 /* DebugLogDemo.app */, 102 | 1FD4695B1957186500BC0073 /* DebugLogDemoTests.xctest */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | 1FD469501957186500BC0073 /* DebugLogDemo */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 1FD469531957186500BC0073 /* AppDelegate.swift */, 111 | 1FD469551957186500BC0073 /* Images.xcassets */, 112 | 1FD469511957186500BC0073 /* Supporting Files */, 113 | ); 114 | path = DebugLogDemo; 115 | sourceTree = ""; 116 | }; 117 | 1FD469511957186500BC0073 /* Supporting Files */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 1FD469521957186500BC0073 /* Info.plist */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | 1FD4695E1957186500BC0073 /* DebugLogDemoTests */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 1FD469AF19571E5F00BC0073 /* DebugLogDemoTests.swift */, 129 | 1FD4695F1957186500BC0073 /* Supporting Files */, 130 | ); 131 | path = DebugLogDemoTests; 132 | sourceTree = ""; 133 | }; 134 | 1FD4695F1957186500BC0073 /* Supporting Files */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 1FD469601957186500BC0073 /* Info.plist */, 138 | ); 139 | name = "Supporting Files"; 140 | sourceTree = ""; 141 | }; 142 | 1FD4698719571D7A00BC0073 /* DebugLog */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 1FD4699719571D7A00BC0073 /* DebugLog.swift */, 146 | 1FD4699619571D7A00BC0073 /* DebugLog+Printable.swift */, 147 | 1FF76470195BB00800756B5E /* DebugLog+ClassParsing.swift */, 148 | 1F511160195BC12800A26D41 /* DDFileReader+DebugLog.swift */, 149 | ); 150 | name = DebugLog; 151 | path = ../DebugLog; 152 | sourceTree = ""; 153 | }; 154 | 1FF59EAD1AE2195C009C08DB /* Vendor */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | 1FF59EAE1AE2195C009C08DB /* DDFileReader */, 158 | ); 159 | name = Vendor; 160 | path = ../Vendor; 161 | sourceTree = ""; 162 | }; 163 | 1FF59EAE1AE2195C009C08DB /* DDFileReader */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 1FF59EB01AE2195C009C08DB /* DDFileReader */, 167 | ); 168 | path = DDFileReader; 169 | sourceTree = ""; 170 | }; 171 | 1FF59EB01AE2195C009C08DB /* DDFileReader */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 1FF59EB21AE2195C009C08DB /* DDFileReader.swift */, 175 | ); 176 | path = DDFileReader; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXGroup section */ 180 | 181 | /* Begin PBXNativeTarget section */ 182 | 1FD4694D1957186500BC0073 /* DebugLogDemo */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = 1FD469651957186500BC0073 /* Build configuration list for PBXNativeTarget "DebugLogDemo" */; 185 | buildPhases = ( 186 | 1FD4694A1957186500BC0073 /* Sources */, 187 | 1FD4694B1957186500BC0073 /* Frameworks */, 188 | 1FD4694C1957186500BC0073 /* Resources */, 189 | 1FD84DD61BEAC91C000DD5E7 /* ShellScript */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | ); 195 | name = DebugLogDemo; 196 | productName = DebugLogDemo; 197 | productReference = 1FD4694E1957186500BC0073 /* DebugLogDemo.app */; 198 | productType = "com.apple.product-type.application"; 199 | }; 200 | 1FD4695A1957186500BC0073 /* DebugLogDemoTests */ = { 201 | isa = PBXNativeTarget; 202 | buildConfigurationList = 1FD469681957186500BC0073 /* Build configuration list for PBXNativeTarget "DebugLogDemoTests" */; 203 | buildPhases = ( 204 | 1FF59ED41AE21CC4009C08DB /* Run Script (Concat all Swift files) */, 205 | 1FD469571957186500BC0073 /* Sources */, 206 | 1FD469581957186500BC0073 /* Frameworks */, 207 | 1FD469591957186500BC0073 /* Resources */, 208 | ); 209 | buildRules = ( 210 | ); 211 | dependencies = ( 212 | 1FD4695D1957186500BC0073 /* PBXTargetDependency */, 213 | 1FD46978195718A300BC0073 /* PBXTargetDependency */, 214 | 1FD4697A195718A300BC0073 /* PBXTargetDependency */, 215 | 1FE18D67195BC53D00DAFE3A /* PBXTargetDependency */, 216 | ); 217 | name = DebugLogDemoTests; 218 | productName = DebugLogDemoTests; 219 | productReference = 1FD4695B1957186500BC0073 /* DebugLogDemoTests.xctest */; 220 | productType = "com.apple.product-type.bundle.unit-test"; 221 | }; 222 | /* End PBXNativeTarget section */ 223 | 224 | /* Begin PBXProject section */ 225 | 1FD469461957186500BC0073 /* Project object */ = { 226 | isa = PBXProject; 227 | attributes = { 228 | LastSwiftMigration = 0710; 229 | LastSwiftUpdateCheck = 0710; 230 | LastUpgradeCheck = 0730; 231 | ORGANIZATIONNAME = "Yasuhiro Inami"; 232 | TargetAttributes = { 233 | 1FD4694D1957186500BC0073 = { 234 | CreatedOnToolsVersion = 6.0; 235 | }; 236 | 1FD4695A1957186500BC0073 = { 237 | CreatedOnToolsVersion = 6.0; 238 | }; 239 | }; 240 | }; 241 | buildConfigurationList = 1FD469491957186500BC0073 /* Build configuration list for PBXProject "DebugLogDemo" */; 242 | compatibilityVersion = "Xcode 3.2"; 243 | developmentRegion = English; 244 | hasScannedForEncodings = 0; 245 | knownRegions = ( 246 | en, 247 | ); 248 | mainGroup = 1FD469451957186500BC0073; 249 | productRefGroup = 1FD4694F1957186500BC0073 /* Products */; 250 | projectDirPath = ""; 251 | projectRoot = ""; 252 | targets = ( 253 | 1FD4694D1957186500BC0073 /* DebugLogDemo */, 254 | 1FD4695A1957186500BC0073 /* DebugLogDemoTests */, 255 | ); 256 | }; 257 | /* End PBXProject section */ 258 | 259 | /* Begin PBXResourcesBuildPhase section */ 260 | 1FD4694C1957186500BC0073 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 1FD469561957186500BC0073 /* Images.xcassets in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | 1FD469591957186500BC0073 /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | /* End PBXResourcesBuildPhase section */ 276 | 277 | /* Begin PBXShellScriptBuildPhase section */ 278 | 1FD84DD61BEAC91C000DD5E7 /* ShellScript */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | ); 285 | outputPaths = ( 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | shellPath = /bin/sh; 289 | shellScript = "${PROJECT_DIR}/../Scripts/concat.sh"; 290 | }; 291 | 1FF59ED41AE21CC4009C08DB /* Run Script (Concat all Swift files) */ = { 292 | isa = PBXShellScriptBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | ); 296 | inputPaths = ( 297 | ); 298 | name = "Run Script (Concat all Swift files)"; 299 | outputPaths = ( 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | shellPath = /bin/sh; 303 | shellScript = "cd ${PROJECT_DIR}/../Scripts\n. concat.sh"; 304 | }; 305 | /* End PBXShellScriptBuildPhase section */ 306 | 307 | /* Begin PBXSourcesBuildPhase section */ 308 | 1FD4694A1957186500BC0073 /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 1FF59ECD1AE21ADC009C08DB /* DebugLog+Printable.swift in Sources */, 313 | 1FF59ECE1AE21ADC009C08DB /* DebugLog+ClassParsing.swift in Sources */, 314 | 1FF59ECB1AE21ADC009C08DB /* DDFileReader.swift in Sources */, 315 | 1FF59ECF1AE21ADC009C08DB /* DDFileReader+DebugLog.swift in Sources */, 316 | 1FD469541957186500BC0073 /* AppDelegate.swift in Sources */, 317 | 1FF59ECC1AE21ADC009C08DB /* DebugLog.swift in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | 1FD469571957186500BC0073 /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | 1FD469B019571E5F00BC0073 /* DebugLogDemoTests.swift in Sources */, 326 | 1FF59ECA1AE21A9C009C08DB /* DebugLog.all.swift in Sources */, 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | }; 330 | /* End PBXSourcesBuildPhase section */ 331 | 332 | /* Begin PBXTargetDependency section */ 333 | 1FD4695D1957186500BC0073 /* PBXTargetDependency */ = { 334 | isa = PBXTargetDependency; 335 | target = 1FD4694D1957186500BC0073 /* DebugLogDemo */; 336 | targetProxy = 1FD4695C1957186500BC0073 /* PBXContainerItemProxy */; 337 | }; 338 | 1FD46978195718A300BC0073 /* PBXTargetDependency */ = { 339 | isa = PBXTargetDependency; 340 | target = 1FD4694D1957186500BC0073 /* DebugLogDemo */; 341 | targetProxy = 1FD46977195718A300BC0073 /* PBXContainerItemProxy */; 342 | }; 343 | 1FD4697A195718A300BC0073 /* PBXTargetDependency */ = { 344 | isa = PBXTargetDependency; 345 | target = 1FD4694D1957186500BC0073 /* DebugLogDemo */; 346 | targetProxy = 1FD46979195718A300BC0073 /* PBXContainerItemProxy */; 347 | }; 348 | 1FE18D67195BC53D00DAFE3A /* PBXTargetDependency */ = { 349 | isa = PBXTargetDependency; 350 | target = 1FD4694D1957186500BC0073 /* DebugLogDemo */; 351 | targetProxy = 1FE18D66195BC53D00DAFE3A /* PBXContainerItemProxy */; 352 | }; 353 | /* End PBXTargetDependency section */ 354 | 355 | /* Begin XCBuildConfiguration section */ 356 | 1FD469631957186500BC0073 /* Debug */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | CLANG_ENABLE_MODULES = YES; 363 | CLANG_ENABLE_OBJC_ARC = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_CONSTANT_CONVERSION = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INT_CONVERSION = YES; 370 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 371 | CLANG_WARN_UNREACHABLE_CODE = YES; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = NO; 375 | ENABLE_STRICT_OBJC_MSGSEND = YES; 376 | ENABLE_TESTABILITY = YES; 377 | GCC_C_LANGUAGE_STANDARD = gnu99; 378 | GCC_DYNAMIC_NO_PIC = NO; 379 | GCC_OPTIMIZATION_LEVEL = 0; 380 | GCC_PREPROCESSOR_DEFINITIONS = ( 381 | "DEBUG=1", 382 | "$(inherited)", 383 | ); 384 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 385 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 386 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 387 | GCC_WARN_UNDECLARED_SELECTOR = YES; 388 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 389 | GCC_WARN_UNUSED_FUNCTION = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 392 | METAL_ENABLE_DEBUG_INFO = YES; 393 | ONLY_ACTIVE_ARCH = YES; 394 | OTHER_SWIFT_FLAGS = "-DDEBUG"; 395 | SDKROOT = iphoneos; 396 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 397 | TARGETED_DEVICE_FAMILY = "1,2"; 398 | }; 399 | name = Debug; 400 | }; 401 | 1FD469641957186500BC0073 /* Release */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 406 | CLANG_CXX_LIBRARY = "libc++"; 407 | CLANG_ENABLE_MODULES = YES; 408 | CLANG_ENABLE_OBJC_ARC = YES; 409 | CLANG_WARN_BOOL_CONVERSION = YES; 410 | CLANG_WARN_CONSTANT_CONVERSION = YES; 411 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 412 | CLANG_WARN_EMPTY_BODY = YES; 413 | CLANG_WARN_ENUM_CONVERSION = YES; 414 | CLANG_WARN_INT_CONVERSION = YES; 415 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 419 | COPY_PHASE_STRIP = YES; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 430 | METAL_ENABLE_DEBUG_INFO = NO; 431 | OTHER_SWIFT_FLAGS = ""; 432 | SDKROOT = iphoneos; 433 | TARGETED_DEVICE_FAMILY = "1,2"; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 1FD469661957186500BC0073 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 442 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 443 | INFOPLIST_FILE = DebugLogDemo/Info.plist; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 445 | PRODUCT_BUNDLE_IDENTIFIER = "com.inamiy.${PRODUCT_NAME:rfc1034identifier}"; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | }; 448 | name = Debug; 449 | }; 450 | 1FD469671957186500BC0073 /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 454 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 455 | INFOPLIST_FILE = DebugLogDemo/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | PRODUCT_BUNDLE_IDENTIFIER = "com.inamiy.${PRODUCT_NAME:rfc1034identifier}"; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | }; 460 | name = Release; 461 | }; 462 | 1FD469691957186500BC0073 /* Debug */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | FRAMEWORK_SEARCH_PATHS = ( 466 | "$(SDKROOT)/Developer/Library/Frameworks", 467 | "$(inherited)", 468 | ); 469 | GCC_PREPROCESSOR_DEFINITIONS = ( 470 | "DEBUG=1", 471 | "$(inherited)", 472 | ); 473 | INFOPLIST_FILE = DebugLogDemoTests/Info.plist; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 475 | METAL_ENABLE_DEBUG_INFO = YES; 476 | PRODUCT_BUNDLE_IDENTIFIER = "com.inamiy.${PRODUCT_NAME:rfc1034identifier}"; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | }; 479 | name = Debug; 480 | }; 481 | 1FD4696A1957186500BC0073 /* Release */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | FRAMEWORK_SEARCH_PATHS = ( 485 | "$(SDKROOT)/Developer/Library/Frameworks", 486 | "$(inherited)", 487 | ); 488 | INFOPLIST_FILE = DebugLogDemoTests/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 490 | METAL_ENABLE_DEBUG_INFO = NO; 491 | PRODUCT_BUNDLE_IDENTIFIER = "com.inamiy.${PRODUCT_NAME:rfc1034identifier}"; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | }; 494 | name = Release; 495 | }; 496 | /* End XCBuildConfiguration section */ 497 | 498 | /* Begin XCConfigurationList section */ 499 | 1FD469491957186500BC0073 /* Build configuration list for PBXProject "DebugLogDemo" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 1FD469631957186500BC0073 /* Debug */, 503 | 1FD469641957186500BC0073 /* Release */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | defaultConfigurationName = Release; 507 | }; 508 | 1FD469651957186500BC0073 /* Build configuration list for PBXNativeTarget "DebugLogDemo" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | 1FD469661957186500BC0073 /* Debug */, 512 | 1FD469671957186500BC0073 /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | defaultConfigurationName = Release; 516 | }; 517 | 1FD469681957186500BC0073 /* Build configuration list for PBXNativeTarget "DebugLogDemoTests" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 1FD469691957186500BC0073 /* Debug */, 521 | 1FD4696A1957186500BC0073 /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | /* End XCConfigurationList section */ 527 | }; 528 | rootObject = 1FD469461957186500BC0073 /* Project object */; 529 | } 530 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo.xcodeproj/xcshareddata/xcschemes/Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DebugLogDemo 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/22. 6 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool 17 | { 18 | #if false 19 | DebugLog.printHandler = { body, filename, functionName, line in 20 | println(body) 21 | } 22 | #endif 23 | 24 | LOG() // prints __FUNCTION__ 25 | LOG("") // prints break 26 | LOG("=== DEBUG ===") // LOG = DebugLog.print 27 | 28 | LOG_OBJECT(self) // LOG_OBJECT(argument) = prints argument name 29 | LOG_OBJECT(self.dynamicType) 30 | LOG_OBJECT(AppDelegate.self) 31 | 32 | // TODO: returns (Metatype) 33 | //LOG_OBJECT(Int.self) 34 | 35 | let int = 3 36 | LOG_OBJECT(int) 37 | 38 | let float: Float = 3.0 39 | LOG_OBJECT(float) 40 | 41 | let rect: CGRect = CGRect(x: 10, y: 20, width: 30, height: 40) 42 | LOG_OBJECT(rect) 43 | 44 | let range: Range = 1 ..< 3 45 | LOG_OBJECT(range) 46 | 47 | let nsRange: NSRange = NSMakeRange(2, 4) 48 | LOG_OBJECT(nsRange) 49 | 50 | let transform = CGAffineTransformIdentity 51 | LOG_OBJECT(transform) 52 | 53 | let transform3D = CATransform3DIdentity 54 | LOG_OBJECT(transform3D) 55 | 56 | let currentThread = NSThread.currentThread() 57 | LOG(currentThread) 58 | 59 | LOG("") 60 | 61 | func testOptional() 62 | { 63 | LOG() 64 | 65 | var optional: Int? = nil 66 | LOG_OBJECT(optional) 67 | 68 | optional = 111 69 | LOG_OBJECT(optional) 70 | 71 | var impOptional: String! = nil 72 | //LOG_OBJECT(impOptional) // comment-out: accessing impOptional=nil will crash 73 | 74 | impOptional = "hoge" 75 | LOG_OBJECT(impOptional) 76 | } 77 | 78 | testOptional() 79 | LOG("") 80 | 81 | func testDoubleOptional() 82 | { 83 | LOG() 84 | 85 | var optional2: Int?? = nil 86 | LOG_OBJECT(optional2) 87 | 88 | optional2 = Optional(nil) // != nil 89 | LOG_OBJECT(optional2) 90 | 91 | optional2 = 111 92 | LOG_OBJECT(optional2) 93 | 94 | var impOptional2: String!! = nil 95 | //LOG_OBJECT(impOptional2) // comment-out: accessing impOptional=nil will crash 96 | 97 | impOptional2 = Optional(nil) 98 | LOG_OBJECT(impOptional2) 99 | 100 | impOptional2 = "hoge" 101 | LOG_OBJECT(impOptional2) 102 | } 103 | 104 | testDoubleOptional() 105 | LOG("") 106 | 107 | func testAsync() 108 | { 109 | LOG() 110 | 111 | // dispatch_group_async test 112 | let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) 113 | let group = dispatch_group_create() 114 | 115 | for i in 0...9 { 116 | dispatch_group_async(group, queue) { 117 | LOG("dispatch_group_async \(i)") 118 | } 119 | } 120 | dispatch_group_notify(group, queue) { 121 | LOG("dispatch_group_async done") 122 | } 123 | dispatch_group_wait(group, DISPATCH_TIME_FOREVER) 124 | } 125 | 126 | testAsync() 127 | LOG("") 128 | 129 | 130 | self.window = UIWindow(frame: UIScreen.mainScreen().bounds) 131 | // Override point for customization after application launch. 132 | self.window!.backgroundColor = UIColor.whiteColor() 133 | self.window!.makeKeyAndVisible() 134 | self.window?.rootViewController = UIViewController() 135 | 136 | return true 137 | } 138 | 139 | func applicationWillResignActive(application: UIApplication) { 140 | LOG() 141 | } 142 | 143 | func applicationDidEnterBackground(application: UIApplication) { 144 | LOG() 145 | } 146 | 147 | func applicationWillEnterForeground(application: UIApplication) { 148 | LOG() 149 | } 150 | 151 | func applicationDidBecomeActive(application: UIApplication) { 152 | LOG() 153 | } 154 | 155 | func applicationWillTerminate(application: UIApplication) { 156 | LOG() 157 | } 158 | 159 | } 160 | 161 | -------------------------------------------------------------------------------- /Demo/DebugLogDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Demo/DebugLogDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Demo/DebugLogDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Demo/DebugLogDemoTests/DebugLogDemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DebugLogDemoTests.swift 3 | // DebugLogDemoTests 4 | // 5 | // Created by Yasuhiro Inami on 2014/06/22. 6 | // Copyright (c) 2014年 Yasuhiro Inami. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import CoreGraphics 11 | import QuartzCore 12 | 13 | class DebugLogTests: XCTestCase 14 | { 15 | override func setUp() 16 | { 17 | super.setUp() 18 | 19 | print("") 20 | print("===== SET UP =====") 21 | #if DEBUG 22 | print("=== DEBUG MODE ===") 23 | #endif 24 | } 25 | 26 | override func tearDown() 27 | { 28 | print("") 29 | print("===== TEAR DOWN =====") 30 | 31 | super.tearDown() 32 | } 33 | 34 | func testDebugLog() 35 | { 36 | #if false 37 | DebugLog.printHandler = { body, filename, functionName, line in 38 | println(body) 39 | } 40 | #endif 41 | 42 | LOG() // prints __FUNCTION__ 43 | LOG("") // prints break 44 | LOG("=== DEBUG ===") // LOG = DebugLog.print 45 | 46 | LOG_OBJECT(self) // LOG_OBJECT(argument) = prints argument name 47 | LOG_OBJECT(self.dynamicType) 48 | 49 | // TODO: returns (Metatype) 50 | //LOG_OBJECT(Int.self) 51 | 52 | let int = 3 53 | LOG_OBJECT(int) 54 | 55 | let float: Float = 3.0 56 | LOG_OBJECT(float) 57 | 58 | let rect: CGRect = CGRect(x: 10, y: 20, width: 30, height: 40) 59 | LOG_OBJECT(rect) 60 | 61 | let range: Range = 1 ..< 3 62 | LOG_OBJECT(range) 63 | 64 | let nsRange: NSRange = NSMakeRange(2, 4) 65 | LOG_OBJECT(nsRange) 66 | 67 | let transform = CGAffineTransformIdentity 68 | LOG_OBJECT(transform) 69 | 70 | let transform3D = CATransform3DIdentity 71 | LOG_OBJECT(transform3D) 72 | 73 | let currentThread = NSThread.currentThread() 74 | LOG(currentThread) 75 | 76 | LOG("") 77 | 78 | func testOptional() 79 | { 80 | LOG() 81 | 82 | var optional: Int? = nil 83 | LOG_OBJECT(optional) 84 | 85 | optional = 111 86 | LOG_OBJECT(optional) 87 | 88 | var impOptional: String! = nil 89 | //LOG_OBJECT(impOptional) // comment-out: accessing impOptional=nil will crash 90 | 91 | impOptional = "hoge" 92 | LOG_OBJECT(impOptional) 93 | } 94 | 95 | testOptional() 96 | LOG("") 97 | 98 | func testDoubleOptional() 99 | { 100 | LOG() 101 | 102 | var optional2: Int?? = nil 103 | LOG_OBJECT(optional2) 104 | 105 | optional2 = Optional(nil) // != nil 106 | LOG_OBJECT(optional2) 107 | 108 | optional2 = 111 109 | LOG_OBJECT(optional2) 110 | 111 | var impOptional2: String!! = nil 112 | //LOG_OBJECT(impOptional2) // comment-out: accessing impOptional=nil will crash 113 | 114 | impOptional2 = Optional(nil) 115 | LOG_OBJECT(impOptional2) 116 | 117 | impOptional2 = "hoge" 118 | LOG_OBJECT(impOptional2) 119 | } 120 | 121 | testDoubleOptional() 122 | LOG("") 123 | 124 | func testAsync() 125 | { 126 | LOG() 127 | 128 | // dispatch_group_async test 129 | let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) 130 | let group = dispatch_group_create() 131 | 132 | for i in 0...9 { 133 | dispatch_group_async(group, queue) { 134 | LOG("dispatch_group_async \(i)") 135 | } 136 | } 137 | dispatch_group_notify(group, queue) { 138 | LOG("dispatch_group_async done") 139 | } 140 | dispatch_group_wait(group, DISPATCH_TIME_FOREVER) 141 | } 142 | 143 | testAsync() 144 | LOG("") 145 | } 146 | 147 | func testPrintlnPerformance() 148 | { 149 | self.measureBlock() { 150 | for _ in 0 ..< 1000 { 151 | #if DEBUG 152 | print("hoge") 153 | #endif 154 | } 155 | } 156 | } 157 | 158 | // try `OTHER_SWIFT_FLAGS = -D DEBUG` on/off 159 | func testDebugLogPerformance() 160 | { 161 | self.measureBlock() { 162 | for _ in 0 ..< 1000 { 163 | LOG("hoge") 164 | } 165 | } 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /Demo/DebugLogDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yasuhiro Inami 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DebugLog 2 | ======== 3 | 4 | DebugLog macro alternative for Swift, replacing old C macros e.g. [Log-YIHelper](https://github.com/inamiy/Log-YIHelper/blob/master/NSLog%2BYIHelper.h). 5 | 6 | 7 | How to use 8 | ---------- 9 | 10 | 1. Drag & drop `DebugLog.all.swift` to your Xcode project. 11 | 2. Set `OTHER_SWIFT_FLAGS = -D DEBUG` in your Xcode project target. 12 | 13 | ``` 14 | LOG() 15 | 16 | LOG("Hello World!") 17 | 18 | LOG_OBJECT(self.window) 19 | LOG_OBJECT(AppDelegate.self) 20 | 21 | let int: Int = 3 22 | LOG_OBJECT(int) 23 | 24 | let float: Float = 3.0 25 | LOG_OBJECT(float) 26 | 27 | let rect: CGRect = CGRect(x: 10, y: 20, width: 30, height: 40) 28 | LOG_OBJECT(rect) 29 | 30 | let range: Range = 1...3 31 | LOG_OBJECT(range) 32 | 33 | let nsRange: NSRange = NSMakeRange(2, 4) 34 | LOG_OBJECT(nsRange) 35 | 36 | let optional: Int? = nil 37 | LOG_OBJECT(optional) 38 | ``` 39 | 40 | will display: 41 | 42 | ``` 43 | 2015-12-12 18:01:00.375 [AppDelegate.application(_:didFinishLaunchingWithOptions:):24] 44 | 2015-12-12 18:01:00.376 [AppDelegate:26] Hello World! 45 | 2015-12-12 18:01:00.380 [AppDelegate:28] self.window = nil 46 | 2015-12-12 18:01:00.381 [AppDelegate:29] AppDelegate.self = DebugLogDemo.AppDelegate 47 | 2015-12-12 18:01:00.381 [AppDelegate:32] int = 3 48 | 2015-12-12 18:01:00.382 [AppDelegate:35] float = 3.0 49 | 2015-12-12 18:01:00.382 [AppDelegate:38] rect = (10.0, 20.0, 30.0, 40.0) 50 | 2015-12-12 18:01:00.383 [AppDelegate:41] range = 1..<4 51 | 2015-12-12 18:01:00.383 [AppDelegate:44] nsRange = (2,4) 52 | 2015-12-12 18:01:00.384 [AppDelegate:47] optional = nil 53 | ``` 54 | Note 55 | ---------- 56 | `LOG_OBJECT` does not print variable names on Devices. Output would look like this. 57 | 58 | ``` 59 | 2015-12-12 18:01:00.375 [AppDelegate.application(_:didFinishLaunchingWithOptions:):24] 60 | 2015-12-12 18:01:00.376 [AppDelegate:26] Hello World! 61 | 2015-12-12 18:01:00.380 [AppDelegate:28] nil 62 | 2015-12-12 18:01:00.381 [AppDelegate:29] DebugLogDemo.AppDelegate 63 | 2015-12-12 18:01:00.381 [AppDelegate:32] 3 64 | 2015-12-12 18:01:00.382 [AppDelegate:35] 3.0 65 | 2015-12-12 18:01:00.382 [AppDelegate:38] (10.0, 20.0, 30.0, 40.0) 66 | 2015-12-12 18:01:00.383 [AppDelegate:41] 1..<4 67 | 2015-12-12 18:01:00.383 [AppDelegate:44] (2,4) 68 | 2015-12-12 18:01:00.384 [AppDelegate:47] nil 69 | ``` 70 | 71 | For further customization, change default `Debug.printHandler` to print in any format & logging destination. 72 | 73 | More information is available at [Qiita](http://qiita.com/inamiy/items/c4e137309725485dc195) (in Japanese). 74 | -------------------------------------------------------------------------------- /Scripts/concat.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #cat DebugLog/*.swift Vendor/DDFileReader/DDFileReader/*.swift 4 | awk 'FNR==1{print ""}{print}' ../DebugLog/*.swift ../Vendor/DDFileReader/DDFileReader/*.swift > ../DebugLog.all.swift --------------------------------------------------------------------------------