mirror of
https://github.com/UrbanApps/Armchair.git
synced 2026-04-17 14:39:48 +02:00
Add global method to set logger closure
Add information into README.md
This commit is contained in:
@@ -234,6 +234,11 @@ The `debugEnabled` configuration is useful for testing how your review prompt po
|
||||
GETTER: Armchair.debugEnabled() -> Bool
|
||||
SETTER: Armchair.debugEnabled(debugEnabled: Bool)
|
||||
|
||||
##### Logging
|
||||
Armchair allows you to set a closure to capture debug log and to plug in the desired logging framework.
|
||||
|
||||
Armchair.logger(logger: ArmchairLogger)
|
||||
|
||||
##### iOS Only Configuration
|
||||
|
||||
These configuration functions only make sense for iOS builds due to their dependency on iOS-only frameworks and functions.
|
||||
|
||||
@@ -563,6 +563,18 @@ public func shouldIncrementUseCountClosure(shouldIncrementUseCountClosure: Armch
|
||||
Manager.defaultManager.shouldIncrementUseCountClosure = shouldIncrementUseCountClosure
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: Armchair Logger Protocol
|
||||
public typealias ArmchairLogger = (Manager, log: String, file: StaticString, function: StaticString, line: UInt) -> Void
|
||||
|
||||
/*
|
||||
* Set a closure to capture debug log and to plug in the desired logging framework.
|
||||
*/
|
||||
public func logger(logger: ArmchairLogger) {
|
||||
Manager.defaultManager.logger = logger
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
// MARK: Armchair Defaults Protocol
|
||||
|
||||
@@ -1715,8 +1727,6 @@ public class Manager : ArmchairManager {
|
||||
// MARK: -
|
||||
// MARK: Debug
|
||||
|
||||
public typealias ArmchairLogger = (Manager, log: String, file: StaticString, function: StaticString, line: UInt) -> Void
|
||||
|
||||
let lockQueue = dispatch_queue_create("com.armchair.lockqueue", nil)
|
||||
|
||||
public var logger: ArmchairLogger = { manager, log, file, function, line in
|
||||
|
||||
Reference in New Issue
Block a user