TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Nov 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Nguyen Phu Nghia.
Depends on: | |
RealmSwift | >= 0 |
Realm | >= 0 |
NLogProtocol | >= 0 |
NLog is a fast, simple and more powerful logging Framework for iOS.
Inspired by CocoalumberjackLog and RGA Log.
**v3.0.3 - 10/31/2016 no comment
**v3.0.2 - 10/31/2016 update syntax to swift 3
**v1.2.26 - 10/31/2016 update NLogProtocol
**v1.2.25 - 10/31/2016 update NLogProtocol
**v1.2.24 - 10/31/2016 added NLogProtocol
**v1.2.23 - 10/19/2016 test lan 2
**v1.2.22 - 19/10/2016
asdfasdf
v1.0.9 - 03/20/2016
v1.0.5 - 03/04/2016
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 provides the view to see logs like console log and more fuctions: