Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 2 months ago
JSON representation

Simple logger for Swift that can be extended with custom loggers

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 OneLogger

struct 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")
}
}

}

```