Swiftpack.co - sinoru/swift-unified-log as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by sinoru.
sinoru/swift-unified-log v2.0.0
The logger for all Swift project.
⭐️ 0
🕓 2 weeks ago
iOS macOS watchOS tvOS linux windows android wasi
.package(url: "https://github.com/sinoru/swift-unified-log.git", from: "v2.0.0")

swift-unified-log

Test

This library will make you log with a single line with all benefits of os.Logging, swift-log features.

Getting started

If you have a server-side Swift application, or maybe a cross-platform (for example Linux & macOS) app/library, and you would like to log, we think targeting this logging API package is a great idea. Below you'll find all you need to know to get started.

Adding the dependency

swift-unified-log is designed for Swift 5.3 and later. To depend on the logging API package, you need to declare your dependency in your Package.swift:

.package(url: "https://github.com/sinoru/swift-unified-log.git", from: "2.0.0"),

and to your application/library target, add "UnifiedLogging" to your dependencies, e.g. like this:

.target(name: "BestExampleApp", dependencies: [
    .product(name: "UnifiedLogging", package: "swift-unified-log")
],

Let's log

// 1) let's import the logging API package
import UnifiedLogging

// 2) we need to create a logger
let logger = Logger()

// 3) we're now ready to use it
logger.log(level: .info, "Hello World!")

GitHub

link
Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics