The FQCN of LogSnag4J is cc.ricecx.logsnag4j
. It is available on Maven Central.To add LogSnag4J to your project,
follow the instructions below for your specified build tool.
To add LogSnag4J to your Maven project, use the following:
<dependency>
<groupId>cc.ricecx.logsnag4j</groupId>
<artifactId>logsnag4j</artifactId>
<version>1.1</version>
</dependency>
To add LogSnag4J to your Gradle project, use the following:
Groovy
dependencies {
compile 'cc.ricecx.logsnag4j:logsnag4j:1.1'
}
Kotlin DSL
implementation("cc.ricecx.logsnag4j:logsnag4j:1.1")
Minimum Java version: Java 11
You can define a LogSnag4J
instance in your application by using the following code:
import cc.ricecx.logsnag4j.LogSnagClient;
import cc.ricecx.logsnag4j.Emoji;
import cc.ricecx.logsnag4j.LogSnagRequest;
public class Main {
public void main(String[] args) {
LogSnag logSnagClient = new LogSnagClient("your-api-key", "default-project");
// Simply log a message by parameters
logSnagClient.log("money-received", "paypal", "$100 has been received!", Emoji.of("💵"));
// Or you can log a message by using a LogSnagRequest object
LogSnagRequest logSnagRequest = new LogSnagRequest("money-received", "paypal", "$100 has been received!", Emoji.of("💵"));
// You can either log by using the `log` method or by using the `sendRequest` method
logSnagClient.log(logSnagRequest);
// Or
logSnagRequest.sendRequest(logSnagClient);
}
}
MIT License
Copyright (c) 2022 RiceCX
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.
This is an unofficial wrapper for the LogSnag API. Thank you Shayan for creating LogSnag.