SpeedLog - Fast Debug logging, easy to disable and improve Swift performance optimization
The SpeedLog allows you to remove
import SpeedLog SpeedLog.print("Hello") SpeedLog.print(["Super"], ["Speed"])
SpeedLog.mode = .FuncName SpeedLog.print("Show only FunctionName") //myFunc(): Show only FunctionName SpeedLog.mode = [.FuncName, .FileName] SpeedLog.print("Show FunctionName and File name") //AppDelegate.myFunc(): Show FunctionName and File name SpeedLog.mode = [.FuncName, .FileName, .Line] SpeedLog.print("Show 3 options :)") //AppDelegate.myFunc(): Show 3 options :) SpeedLog.mode = .FullCodeLocation SpeedLog.print("Show fullCode, same as above") //AppDelegate.myFunc(): Show fullCode, same as above SpeedLog.mode = .AllOptions SpeedLog.print("Enable All Features") //2015-11-26 19:32:33.687 AppDelegate.myFunc(): Enable All Features
SpeedLog has nice
UIColor log style.
All you need to do is enable it once by calling
SpeedLog.enableVisualColorLog() SpeedLog.print("Visual:", c) SpeedLog.disableVisualColorLog() SpeedLog.print("Original Restored:", c)
To enable logs you need to add a Swift Compiler
If you use use
Carthage you need to enable it for
SpeedLog framework, not the project itself.
See more details at Stackoverflow
To install it, simply add the following line to your Podfile:
use_frameworks! pod "SpeedLog"
To integrate SpeedLog into your Xcode project using Carthage, specify it in your Cartfile:
* Carthage builds frameworks in
Release mode. This mean if you run
carthage update and include
SpeedLog.framework to the project no output will be printed to console, because it's not printed in release mode.
How to use Carthage with SpeedLog:
SpeedLog.xcodeprojto your project.
SpeedLog.swift file into your project
There are many logging libs I like:
But there is one problem with all of them - it's not possible to disable them before compiling Swift code.
Next step is:
Get the best features from those libs and integrate them into
Please open an issue with bugs and missing features, functionality or ideas for improvements.
Also you can contribute by following these guidelines:
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)
Kostiantyn Koval, thats me :)
SpeedLog is available under the MIT license. See the LICENSE file for more info.