Swiftpack.co - arabianprinceee/SwiftLogger as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by arabianprinceee.
arabianprinceee/SwiftLogger 2.0.0
Lightweight logging framework for iOS and macOS.
⭐️ 1
🕓 11 weeks ago
.package(url: "https://github.com/arabianprinceee/SwiftLogger.git", from: "2.0.0")

SwiftLogger

SwiftLogger is a simple lightweight console logger for iOS and macOS projects.

Customizable and easy to use. That's exactly what you need in your project!

Usage

Swift Package Manager:

Add dependency to your Package.swift file:

.package(url: "https://github.com/arabianprinceee/SwiftLogger.git", exact: "x.x.x")

Then add SwiftLogger to your target's dependencies:

.target(name: "SwiftLogger", dependencies: ["SwiftLogger"]),

Import package:

Then import package to use SwiftLogger in your app:

import SwiftLogger

And that's it!

In-app usage:

Create an instance of Logger:

let defaultLogger = Logger.default
let customLogger = Logger(
    configuration: LoggerConfiguration(
        requiredLogs: [.logLevel, .message] // Pick the logs you need here
    )
)

And then use it easily:

Text("Hello, world!")
    .onAppear {
        defaultLogger.log(.information, "This is default logger!")
        customLogger.log(.information, "This is custom logger!")
    }

Author

Ben Mustafa Anas

📨 - anas.mustafa2301@gmail.com

👨🏽‍💻 - https://www.linkedin.com/in/anas-ben-mustafa-a29a5716b/

License

SwiftLogger is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 1
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

SwiftLogger 2.0
11 weeks ago

SwiftLogger 2.0 is already here!

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