ZcashLightClientKit/Tests/TestUtils/LoggerProxy.swift

34 lines
1.2 KiB
Swift
Raw Normal View History

[#209] Add support for multiple instances of the SDKSynchronizer Closes #209. [#845] Introduce ZcashSynchronizerAlias enum Closes #845. [#852] SDKSynchronizer using queues label based on the alias Closes #852. [#847] Remove posibility to use DatabaseStorageManager as singleton Closes #847. [#850] Remove synchronizerConnectionStateChanged notification Closes #850. [#855] Add check if the Alias is already used Closes #855 - Added `UsedAliasesChecker` utility which is used to register aliases that are in use. - `prepare()` and `wipe()` methods now check if the current alias can't be used and if not then `InitializerError.aliasAlreadyInUse` is thrown/emitted. - Some public methods that could cause harm if used with the Alias that is already in use now throw `SynchronizerError.notPrepared`. Thanks to this the client app is forced to call `prepare()` first. And `prepare()` does check for the Alias. - Added tests for new conditions. [#849] Make InternalSyncProgress aware of the Alias Closes #849. [#853] Only instance with default Alias migrates legacy cache DB Closes #853. [#851] Apply the Alias to the URLs Closes #851. - `Initializer` now updates paths according to alias before paths are used anywhere in the SDK. - Paths update can fail. It would be incovenient for the client apps to handle errors thrown from `Initiliazer` constructor. So the error is then handled in `SDKSynchronizer.prepare()` or `SDKSynchronizer.wipe()`. [#846] Stop using SDKMetrics as singleton (#862) - metrics are not longer a singleton - tests fixed - metrics outside init of the synchronizer [#848] Make logger aware of the alias - logger is now an instance passed throughout the sdk instead of a static proxy [#848] Make logger aware of the alias (#868) - comments addressed [#848] Make logger aware of the alias (#868) - returning protocol back Fix typos [#856] Add possibility to test multiple synchronizers in the sample app Closes #856. - Added `alias` property to `Synchronizer`. - Added `SyncBlocksListViewController` which provides UI to use multiple synchronizers at once. [#209] Add changelog - Add changelog for #209. - Overall improve readability of the rendered changelog. Tickets references are now prefixed with `###` instead of `- `. Fix compilation
2023-03-22 05:47:32 -07:00
//
// LoggerProxy.swift
//
//
// Created by Lukáš Korba on 27.03.2023.
//
import Foundation
import ZcashLightClientKit
var logger = OSLogger(logLevel: .debug)
enum LoggerProxy {
static func debug(_ message: String, file: StaticString = #file, function: StaticString = #function, line: Int = #line) {
logger.debug(message, file: file, function: function, line: line)
}
static func info(_ message: String, file: StaticString = #file, function: StaticString = #function, line: Int = #line) {
logger.info(message, file: file, function: function, line: line)
}
static func event(_ message: String, file: StaticString = #file, function: StaticString = #function, line: Int = #line) {
logger.event(message, file: file, function: function, line: line)
}
static func warn(_ message: String, file: StaticString = #file, function: StaticString = #function, line: Int = #line) {
logger.warn(message, file: file, function: function, line: line)
}
static func error(_ message: String, file: StaticString = #file, function: StaticString = #function, line: Int = #line) {
logger.error(message, file: file, function: function, line: line)
}
}