Swiftpack.co - johnmelodyme/LogToDiscord as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by johnmelodyme.
johnmelodyme/LogToDiscord 1.0.5
A simple package to log server or application log to discord channel with webhook in swift
⭐️ 2
🕓 3 weeks ago
.package(url: "https://github.com/johnmelodyme/LogToDiscord.git", from: "1.0.5")

LogToDiscord

This package is mainly to send message to specific discord channel easily. Whether is from server application, IOS application or MACOS Application.

License

MIT License

Copyright (c) 2022 John Melody Me

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Installation

Insert the following lines into Package.swift

.package(url: "https://github.com/johnmelodyme/LogToDiscord.git", from: "1.0.5"),

Usage:

import LogToDiscord

try LogToDiscord(
        appName: "testing",
        webhookUrl: "webhookUrl"
    ).send(message: "yourMessage", level: Level.Info, delay: 10)

Explanation:

The parameter level are enumeration of various levels of the message being sent to discord channel. The available level are as follows:

public enum Level
{
    case Error
    case Warn
    case Debug
    case Info
}

For demonstration please do refer to example

How it looks:




Contribution:

I Would ❤️ to see any contributions. If you do liked my work, show some ❤️ by ⭐ repo. Also you can appreciate me by buy me a coffee:

Buy Me A Coffee

GitHub

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

Release Notes

3 weeks ago

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