Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enhorn/OneLogger
Simple logger for Swift that can be extended with custom loggers
https://github.com/enhorn/OneLogger
ios logging macos swift swiftpackagemanager tvos watchos
Last synced: 22 days ago
JSON representation
Simple logger for Swift that can be extended with custom loggers
- Host: GitHub
- URL: https://github.com/enhorn/OneLogger
- Owner: enhorn
- License: mit
- Created: 2022-06-19T09:07:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-27T08:45:06.000Z (over 2 years ago)
- Last Synced: 2023-07-31T23:31:12.991Z (over 1 year ago)
- Topics: ios, logging, macos, swift, swiftpackagemanager, tvos, watchos
- Language: Swift
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OneLogger
Simple swift logger that can be extended with custom loggers, that for example send the logging to a web service.
Uses four log levels: `info`, `debug`, `warning` and `error`.
Basic `print` and `file` loggers are available by default.
Used in [OneNetwork](https://github.com/enhorn/OneNetwork).
Comes with [DocC](https://developer.apple.com/documentation/docc) tutorials.
Example usage:
```swift
import OneLoggerstruct MyView: View {
private let logger: OneLogger = OnePrintLogger(level: .debug)
var body: some View {
Button("Print statements") {
logger.info("Info log message") // Not printed due to the logger being at `.debug` level.
logger.debug("Debug log message")
}
}}
```