Swiftpack.co -  janodev/log as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
janodev/log
Log handler for Swift-Log
.package(url: "https://github.com/janodev/log.git", from: "1.0.0")

Swift

A simple log utility.

[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 so it is easy to scan.
  • It doesn’t print elements that are useless in the Xcode console, like the full timestamp and project name.
  • It includes a character · you can use in the Xcode console to filter out OS_Activity garbage and multiline logs.

Installation

dependencies: [
    .package(name: "log", url: "https://github.com/janodev/log.git", from: "1.0.0")
],
targets: [
    .target(
        name: "SomeTarget",
        dependencies: [
            .product(name: "LogDynamic", package: "log")
        ],
// ...

Configuration

Define this as a top level variable (outside any object):

let log = PrintLogger(label: "networking", logLevel: .trace)

GitHub

link
Stars: 1
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

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