FFLumberjack is based on CocoaLumberjack, and encapsulated it:
- The default initialization settings are automatically set and you can use it directly without any settings;
- Unified setting of log format: "Date file line-count: Content": "2024.06.30-17:06:52:151 ViewController 21: Are You OK?";
- The log file name has been uniformly set as "CFBundleName-Time.log": "Example-2024.06.30-15.50.30.log". And it can be imported only once for global use without polluting the namespace.
FFLumberjack can be installed through CocoaPods. In Podfile, just add the following lines:
pod 'FFLumberjack'
Then execute in the terminal:
pod install
FFLumberjack can be installed through Swift Package Manager. URL:
https://github.com/findingfield/FFLumberjack.git
FFLumberjack is very easy to use, first import the library and then give an alias:
import FFLumberjack
typealias MyLog = FFLumberjack
Then you can use MyLog anywhere in your project:
MyLog.verbose("verbose")
MyLog.debug("debug")
MyLog.info("info")
MyLog.warn("warn")
MyLog.error("error")
findingfield, findingfield@qq.com
FFLumberjack is available under the MIT license. See the LICENSE file for more info.