- The number of lines that can be printed + the printing method of the method name => convenient for debugging
- 可以印出行數 + 方法名稱的Print方法 / WWLogger => 方便Debug
dependencies: [
.package(url: "https://github.com/William-Weng/WWPrint.git", .upToNextMajor(from: "1.2.0"))
]
函式 | 功能 |
---|---|
wwPrint(_:file:method:line:isShow:) | 可以印出行數 + 方法名稱的Print方法 => 方便Debug |
build(subsystem:category:) | 建立WWLogger |
build(bundle:category:) | 建立WWLogger |
message(_:level:) | 主控台輸出 |
wwMessage(_:file:method:line:) | 可以印出行數的Debug字串 |
wwFatalError(_:file:line:) | 強制讓App自殺閃退 |
wwAssert(_:message:file:line:) | 有條件讓App自殺閃退 for Debug模式 |
wwAssertionFailure(_:file:line:) | 檢查後已經確定要強制App閃退 for Debug模式 |
wwPrecondition(_:message:file:line:) | 有條件讓App自殺閃退 |
wwPreconditionFailure(_:file:line:) | 檢查後已經確定要強制App閃退 |
import UIKit
import WWPrint
final class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let message = wwMessage("iOS好棒棒")
let logger = WWLogger.build()
print(message)
wwPrint("Hello World!!!")
logger?.message("debug", level: .debug)
logger?.message("info", level: .info)
logger?.message("notice", level: .notice)
logger?.message("warning", level: .warning)
logger?.message("critical", level: .critical)
}
}