swift-log-playground

0.2.0

This Swift package is a logging backend for SwiftLog. It can be usable on Swift Playgrounds.
kkebo/swift-log-playground

What's New

0.2.0

2024-12-24T15:10:25Z

What's Changed

  • build: bump github.com/apple/swift-log from 1.5.4 to 1.6.1 by @dependabot in #6
  • build: bump github.com/apple/swift-log from 1.6.1 to 1.6.2 by @dependabot in #8
  • chore: add .gitattributes by @kkebo in #7
  • ci: add CI by @kkebo in #10
  • feat: adopt Sendable by @kkebo in #9

New Contributors

Full Changelog: 0.1.6...0.2.0

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/kkebo/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()
        }
    }
}

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Thu May 15 2025 20:29:38 GMT-0900 (Hawaii-Aleutian Daylight Time)