Swiftpack.co - kkk669/swift-log-playground as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kkk669.
kkk669/swift-log-playground 0.1.6
This Swift package is a logging backend for SwiftLog. It can be usable on Swift Playgrounds.
⭐️ 0
🕓 4 weeks ago
.package(url: "https://github.com/kkk669/swift-log-playground.git", from: "0.1.6")

LoggingPlayground

License

This Swift package is a logging backend for SwiftLog. It is usable on Swift Playgrounds.

Adding the dependency

You need to declare your dependency in your Package.swift:

.package(url: "https://github.com/kkk669/swift-log-playground", from: "0.1.0"),

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

.target(name: "YourLibrary", dependencies: [
    .product(name: "LoggingPlayground", package: "swift-log-playground")
],

Example (Playground Book or Xcode Playground)

import Logging
import LoggingPlayground

let logger = Logger(label: "main")

LoggingSystem.bootstrap(PlaygroundHandler.init)

logger.debug("The program started.")

Example (App Project)

import Logging
import LoggingPlayground
import SwiftUI

let logger = Logger(label: "main")

@main
struct MyApp: App {
    init() {
        LoggingSystem.bootstrap(PlaygroundHandler.init)
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

GitHub

link
Stars: 0
Last commit: 4 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

0.1.6
4 weeks ago

What's Changed

Full Changelog: https://github.com/kkk669/swift-log-playground/compare/0.1.5...0.1.6

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