You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-28Lines changed: 23 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@
6
6
7
7
## Description
8
8
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
10
11
11
12
## Motivation
12
13
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.
* 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):
48
64
```kt
49
-
// Example json object
65
+
// Example json object from GSON LIB
50
66
val obj =JsonObject()
51
67
obj.addProperty("Test", "Test")
52
68
53
69
val result =
54
70
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
58
71
// 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"))
64
73
// Add a simple text to the debug
65
74
.addText("Text test", "Text test")
66
75
// Add json formatted string to the debug
@@ -76,19 +85,5 @@ val encodedUrl = URLEncoder.encode(
76
85
val code = result.code
77
86
// Prettified url
78
87
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 =newJsonObject();
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(newDebugFile(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>")
0 commit comments