Skip to content

Commit 137ad26

Browse files
committed
Update readme
1 parent 468e7ec commit 137ad26

2 files changed

Lines changed: 23 additions & 30 deletions

File tree

README.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
## Description
88
Plugin Debug is a simple and modern library for collect some debug information of your plugin.
9-
This library is inspired by Debug Paste of @IntellectualSites
9+
This library is inspired by Debug Paste of @IntellectualSites [IntellectualSites](https://github.com/IntellectualSites)
10+
As a backend we use from lucko [bytebin](https://github.com/lucko/bytebin) service to host/upload the debug files
1011

1112
## Motivation
1213
We maintain now more than one plugin/software plugin in java. Now it's time to build an api/library to help us to provide better support for users there use our plugins.
@@ -37,30 +38,38 @@ dependencies {
3738
```kt
3839
dependencies {
3940
// Core
40-
implementation("dev.themeinerlp:plugin-debug:1.0.0")
41+
implementation("dev.themeinerlp:plugin-debug:1.1.0")
4142
// Bukkit Extension
42-
implementation("dev.themeinerlp.plugin-debug:bukkit-extension:1.0.0")
43+
implementation("dev.themeinerlp.plugin-debug:bukkit-extension:1.1.0")
4344
}
4445
```
4546
</details>
4647

47-
Example code(Kotlin):
48+
### Example
49+
50+
We have an example [gradle module](example) with an example bukkit command to retrieve a debug log.
51+
Also, we provide already a pre-hosted web ui for view your logs.
52+
53+
The hosted ui follows this structure:
54+
```
55+
https://debugpaste.onelitefeather.net/#/BYTEBIN_CODE/ENCODED_URL/
56+
```
57+
* BYTEBIN_CODE
58+
* The returned code from ByteBin Server when the upload is successfully
59+
* ENCODED_URL
60+
* The ByteBin Server URL encoded in a friendly style
61+
62+
---
63+
### Example code(Kotlin):
4864
```kt
49-
// Example json object
65+
// Example json object from GSON LIB
5066
val obj = JsonObject()
5167
obj.addProperty("Test", "Test")
5268

5369
val result =
5470
DebugBuilder.builder(BYTEBIN_BASE_URL)
55-
// For this is the bukkit extension required
56-
.enableLatestLogSpigot() // Adds the paper last log
57-
.defaultPaperDebugInformation() // Adds as a parseable yaml format some system relevant information from bukkit
5871
// Adds a file from path wrapped in a placeholder object
59-
.addFile(DebugFile(attollo.dataFolder.toPath().resolve("config.yml"),FileType.YAML,"Config as file object"))
60-
// Adds a file from path
61-
.addFile(attollo.dataFolder.toPath().resolve("config.yml"),FileType.YAML,"Config as file")
62-
// Add yaml formatted string to the debug
63-
.addYAML(attollo.config.saveToString(), "Config")
72+
.addFile(DebugFile(Path.of("config", "config.yml"), FileType.YAML, "Config as file object"))
6473
// Add a simple text to the debug
6574
.addText("Text test", "Text test")
6675
// Add json formatted string to the debug
@@ -76,19 +85,5 @@ val encodedUrl = URLEncoder.encode(
7685
val code = result.code
7786
// Prettified url
7887
val openUrl = "https://debugpaste.onelitefeather.net/#/$code/$encodedUrl/"
79-
val component = MiniMessage.miniMessage().deserialize("<#05b9ff>[Attollo] <yellow><click:OPEN_URL:'$openUrl'>Click <u>here</u> to open the debug paste</click>")
80-
```
81-
**For better formatting we used mini message also the two lines `enableLatestLogSpigot()` and `defaultPaperDebugInformation()` requires the Bukkit Extension.**
82-
83-
Example for java
84-
```java
85-
var obj = new JsonObject();
86-
obj.addProperty("Test", "Test");
87-
88-
var builder = DebugBuilder.builder(BYTEBIN_BASE_URL);
89-
builder = enableLatestLogSpigot(builder);
90-
builder = defaultPaperDebugInformation(builder);
91-
builder.addFile(new DebugFile(Path.of(""), FileType.YAML, "Config as file object"))
92-
.addFile(Path.of(""), FileType.YAML, "Config as file");
93-
var result = builder.upload();
88+
val component = MiniMessage.miniMessage().deserialize("<#05b9ff>[Example] <yellow><click:OPEN_URL:'$openUrl'>Click <u>here</u> to open the debug paste</click>")
9489
```

module.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)