Hawk allows to track Java errors in your applications.
In your build.gradle file write:
dependencies {
implementation("so.hawk:hawkcatcher:1.0.1")
implementation("org.json:json:20250107")
}
Don't forget to import Maven Repository:
repositories {
mavenCentral()
}
First of all, you should register an account on hawk.so.
Then create a Workspace and a Project in there. You'll get an Integration Token.
Create Hawk class instance when script will be ready and pass your Integration Token:
Hawk.init("PASTE_YOUR_TOKEN");You can send errors or other messages to the Hawk manually, for example at your catch blocks or any debug conditions.
Use the .send(message) method for that. This method accepts the message of type Error or string as the first parameter.
Hawk.init("PASTE_YOUR_TOKEN");
Hawk.send("I love Hawk so much ^_^");To config Hawk use config option:
Hawk.init(config -> {
config.setToken(integrationtoken)
.setContext("application", "PlaygroundApp")
.setContext("version", "1.0.0")
.setUser("id", "12345")
.setBeforeSend(payload -> {
payload.put("customField", "Custom Value");
return payload;
});
});