diff --git a/LICENSE b/LICENSE index 0aa8fac..0f30ea9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 CodeX +Copyright (c) 2026 CodeX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index eae3345..9719ff5 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,7 @@ Now you can download(or clone repo) catcher and playground packeges to test it. In PlaygroundApp.Java you will see "import org.catcher.Hawk" that connect catcher. +## License + +This project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**. +See the [LICENSE](./LICENSE) file for the full text. diff --git a/hawk-java/README.md b/hawk-java/README.md new file mode 100644 index 0000000..3144c94 --- /dev/null +++ b/hawk-java/README.md @@ -0,0 +1,69 @@ +# Hawk Java Catcher + +[Hawk](https://github.com/codex-team/hawk) allows to track Java errors in your applications. + +# Installation + +### Import through Maven Repository + +In your build.gradle file write: + +```declarative +dependencies { + implementation("so.hawk:hawkcatcher:1.0.1") + implementation("org.json:json:20250107") +} +``` + +Don't forget to import Maven Repository: + +```declarative +repositories { + mavenCentral() +} +``` + +## Usage + +### Get an Integration Token + +First of all, you should register an account on [hawk.so](https://garage.hawk.so/sign-up). + +Then create a Workspace and a Project in there. You'll get an Integration Token. + +### Initialize Catcher + +Create `Hawk` class instance when script will be ready and pass your Integration Token: + +```java +Hawk.init("PASTE_YOUR_TOKEN"); +``` + +## Manual sending + +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. + +```java +Hawk.init("PASTE_YOUR_TOKEN"); + +Hawk.send("I love Hawk so much ^_^"); +``` + +## Initial config + +To config Hawk use `config` option: + +```java +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; + }); + }); +``` \ No newline at end of file diff --git a/hawk-java/build.gradle b/hawk-java/build.gradle index 89783e0..2a99376 100644 --- a/hawk-java/build.gradle +++ b/hawk-java/build.gradle @@ -21,7 +21,7 @@ dependencies { } group = 'org' -version = '1.0-SNAPSHOT' +version = '1.0.1-SNAPSHOT' description = 'HawkCatcher' java.sourceCompatibility = JavaVersion.VERSION_1_8