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.1.0
The logger for all Swift project.
⭐️ 0
🕓 1 year ago
iOS macOS watchOS tvOS linux windows android wasi
.package(url: "https://github.com/sinoru/swift-unified-log.git", from: "v2.1.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.1.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: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

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