Swiftpack.co - janodevorg/Log as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by janodevorg.
janodevorg/Log 1.1.2
Minimal log utility
⭐️ 0
🕓 1 year ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/janodevorg/Log.git", from: "1.1.2")

Swift

A simple log utility.

Usage

let log = PrintLogger(label: "networking", logLevel: .trace)
log.debug("200 GET https://domain.com/api?1=2")

Installation

dependencies: [
    .package(url: "[email protected]:janodevorg/Log.git", from: "1.1.2")
],
targets: [
    .target(
        name: "SomeTarget",
        dependencies: [
            .product(name: "DumpLogger", package: "Log")
        ],
// ...

Output

[networking] Client.request(resource:co…: 40 · 200 GET https://randomuser.me/api/?results=1&inc=name&seed=abc
[networking]    ReportTests.testFormat():102 · 200 GET https://domain.com/api?1=2
  • It aligns the method name to facilitate visual scanning.
  • It doesn’t print useless elements in the Xcode console, like the full timestamp and project name.
  • It includes a · character you may use in the Xcode console to discard OS_Activity and multiline logs.
  • It logs the output of customDump when the parameter is not a string.

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