Swiftpack.co - bruno-garcia/SentryCocoaLumberjack as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bruno-garcia.
bruno-garcia/SentryCocoaLumberjack 0.0.1-alpha.2
CocoaLumberjack integration for Sentry
⭐️ 7
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/bruno-garcia/SentryCocoaLumberjack.git", from: "0.0.1-alpha.2")

SentryCocoaLumberjack

build

Send your CocoaLumberjack log messages to Sentry.

Using this library

Install it with Swift Package Manager

.package(url: "https://github.com/bruno-garcia/SentryCocoaLumberjack", from: "0.0.1-alpha.2")

Add the Sentry logger to your app:

let sentryLogger = SentryLogger()
DDLog.add(sentryLogger, with: DDLogLevel.info)

Done. All log messages with level info or higher will be stored as breadcrumbs. Logs with level error send an event to Sentry, which include the breadcrumbs.

These log levels can be configured. Check out the example console app in this repo.

A low quality gif to give you an idea

Running the example

Run the example

First add your DSN to Example/main.swift.

Run it:

swift run

2020-09-05 20:39:59:741 Example[74424:4634517] 🔊 Noise message again: Something trivial.
2020-09-05 20:39:59:741 Example[74424:4634517] 🌍 Check this out, something's weird.
2020-09-05 20:39:59:741 Example[74424:4634517] 🪓🌴 Something relevant happened. Be aware.
2020-09-05 20:39:59:741 Example[74424:4634517] 🍁 Warning! This isn't good.
2020-09-05 20:39:59:741 Example[74424:4634517] 🔥 Broken stuff! Please fix this!

The example is configured with custom minimum levels so you can see info, warning and error level events sent to Sentry. All levels are stored as breadcrumbs.

GitHub

link
Stars: 7
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 years ago

Added license: MIT
Support for more Swift versions
Build with GH actions
Fixed watchOS declared min version: 3

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