swift-log-playground

0.1.6

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

What's New

0.1.6

2024-01-26T15:03:57Z

What's Changed

  • build: bump swift-tools-version to 5.9 by @kkk669 in #5
  • fix: fix broken Package.swift
  • build: bump swift-log to 1.5.4

Full Changelog: 0.1.5...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()
        }
    }
}

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Tue Dec 03 2024 00:37:18 GMT-1000 (Hawaii-Aleutian Standard Time)