测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布最新发布 | 2016年11月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Nguyen Phu Nghia 维护。
依赖 | |
RealmSwift | >= 0 |
Realm | >= 0 |
NLogProtocol | >= 0 |
NLog 是一个快速、简单且功能更强大的 iOS 日志框架。
灵感来源于 CocoalumberjackLog 和 RGA Log。
**v3.0.3 - 2016年10月31日 没有注释
**v3.0.2 - 2016年10月31日 更新语法为 Swift 3
**v1.2.26 - 2016年10月31日 更新 NLogProtocol
**v1.2.25 - 2016年10月31日 更新 NLogProtocol
**v1.2.24 - 2016年10月31日 添加 NLogProtocol
**v1.2.23 - 2016年10月19日 测试语言2
**v1.2.22 - 2016年10月19日
asdfasdf
v1.0.9 - 2016年3月20日
v1.0.5 - 2016年3月4日
use_frameworks!
pod 'NLog'
import NLog
public enum Level: String {
case Info = "Info"
case Error = "Error"
case Debug = "Debug"
case Warning = "Warning"
case Server = "Server"
}
NLog.debug("Hello world!")
NLog.server("Authentication failed", "OWNER_SERVER") // Tag = OWNER_SERVER
NLog.info("More colorful", color: UIColor.blueColor())
NLog.rollingFrequency = 3600 * 24 * 7 // auto remove log overdue for a week.
NLog.limitDisplayedCharacters = 1000 // limit displayed chracteristics of a message on console log.
NLog.levels = [.Debug, .Error, .Server] // only allow this levels - Default is allow all.
NLog.filters = ["Apple", "Orange", "Banana"] // only allow logs contain filters.
NLog.maxStackTrace = 10 // maximum stack you wanna trace
NLog.replaceNLog = {(level, tag, message, color, file, function, line) in
//maybe in some cases, you don't wanna use us, can use this to replace NLog by another Log you want.
}
NLog.levelColors[.Debug] = UIColor.blueColor() // change the default level color
let logString = NLog.getLogString() // get all log
// get with filter
let logStringFiltered = NLog.getLogString(level: .Server, tag: "OWNER_SERVER", filter: "user/me", limit: 1000, stackTrace: false)
NLog.saveToFile(path: "../log.txt") // optional filter like query log
NLog提供用于查看日志的视图,例如控制台日志和其他更多功能。