TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✗ |
Maintained by Furkan Yilmaz, goktugyil.
Swift Logging Utility in Xcode & Google Docs
class MyAwesomeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
QL1("Debug")
QL2("Info")
QL3("Warning")
awesomeFunction()
}
func awesomeFunction() {
QL4("Error")
}
}
Paste this where QorumLogs is initiliazed:
QorumLogs.onlyShowThisFile(NewClass)
In production, send all your logs to Google Docs with only 1 line of extra code.
QorumLogs.enabled = false
QorumOnlineLogs.enabled = true
System logs are white (or black) after all, yours are not :)
If you don’t have Alcatraz or XcodeColors installed, lets install them. Open up your terminal and paste this:
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
Download and drop 'QorumLogs.swift’ in your project.
In your AppDelegate or anywhere else enter this: (If Cocoapods or Carthage you must add import QorumLogs
)
QorumLogs.enabled = true
QorumLogs.test()
Congratulations!
Sets the minimum log level that is seen in the debug area:
QorumLogs.minimumLogLevelShown = 2
QorumOnlineLogs.minimumLogLevelShown = 4 // Its a good idea to have OnlineLog level a bit higher
QL1("mylog") // Doesn't show this level anywhere, because minimum level is 2
QL2("mylog") // Shows this only in debugger
QL3("mylog") // Shows this only in debugger
QL4("mylog") // Shows this in debugger and online logs
QL methods can print in both Debugger and Google Docs, depending on which is active.
You need to write the name of the actual file, you can do this by a string and also directly the class name can be appropriate if it is the same as the file name. Add the following code where you setup QorumLogs:
QorumLogs.onlyShowThisFile(MyAwesomeViewController)
QorumLogs.onlyShowThisFile("MyAwesomeViewController")
You do not need the extension of the file.
QLPlusLine()
QL2("Text between line")
QLShortLine()
Add custom colors for Mac, iOS, tvOS:
QorumLogs.colorsForLogLevels[0] = QLColor(r: 255, g: 255, b: 0)
QorumLogs.colorsForLogLevels[1] = QLColor(red: 255, green: 20, blue: 147)
QL1("Mylog")
QorumOnlineLogs.extraInformation["userId"] = "sfkoFvvbKgr"
QorumOnlineLogs.extraInformation["name"] = "Will Smith"
QL1("Will is awesome!")
QL5("Will rules!")
You only need to set the extraInformation one time.
KZLinkedConsole is a plugin for Xcode which add clickable link to place in code from log was printed. All you need to do is install it. For more information go to https://github.com/krzysztofzablocki/KZLinkedConsole
Unfortunately you can’t just select the rows inside Google Docs and delete them. You need to select the rows where there are row numbers, then right click, then press delete click “Delete rows x-y” http://i.imgur.com/0XyAAbD.png
QorumLogs is available under the MIT license. See the LICENSE file.
Debugging, logging, remote logging, remote debugging, qorum app, swift log, library, framework, tool, google docs, google drive, google forms