An unified logging system for iOS and macOS with internal caching system as well as server replication support.
- Log on to a log server.
- Log on to a local cache.
- Schedule sending logs.
- Distinguish between types of logs such as(
Request
,Response
,Internal
).
Add in Package.swift
or directly in Xcode Project dependencies
section:
.package(url: "https://github.com/hamed8080/logger.git", .upToNextMinor(from: "1.2.1")),
Add in Podfile
:
pod 'Logger', :git => 'http://pubgi.sandpod.ir/chat/ios/logger.git', :tag => '1.2.1'
let config = LoggerConfig(
prefix: "YOUR_PREFIX",
logServerURL: "YOUR_SERVER_ADDRESS",
logServerMethod: "PUT",
persistLogsOnServer: true,
isDebuggingLogEnabled: true
)
let logger = Logger(config: config)
logger.delegate = delegate
logger.log(title: "YOUR_TITLE", message: "YOUR_MESSAGE", persist: true, type: .internalLog)
logger.logJSON(title: "YOUR_TITLE", jsonString: "[{"name": "hamed"}]", persist: false, type: .received)
Logger.clear(prefix: "YOUR_PREFIX")
For more information about how to use Logger visit Documentation
Please see the contributing guide for more information.