docs: update api-example

This commit is contained in:
2023-09-27 21:52:05 +08:00
parent 7c066af116
commit 184701e563
2 changed files with 24 additions and 12 deletions

View File

@@ -42,10 +42,12 @@ Logs inside the API will be printed using this tag.
```kotlin
// Via the configs method
YukiReflection.configs {
debugTag = "YourCustomTag"
debugLog {
tag = "YourCustomTag"
}
}
// Set directly
YukiReflection.Configs.debugTag = "YourCustomTag"
YLog.Configs.tag = "YourCustomTag"
```
### Enable or Disable Debug Mode
@@ -76,10 +78,12 @@ This function is enabled by default, and disable will stop `YukiReflection` outp
```kotlin
// Via the configs method
YukiReflection.configs {
isEnableLogs = true
debugLog {
isEnable = true
}
}
// Set directly
YukiReflection.Configs.isEnableLogs = true
YLog.Configs.isEnable = true
```
### Use the configs Method to Configure
@@ -90,9 +94,11 @@ In order to configure multiple features at once, you can directly use the `YukiR
```kotlin
YukiReflection.configs {
debugTag = "YourCustomTag"
debugLog {
tag = "YourCustomTag"
isEnable = true
}
isDebug = true
isEnableLogs = true
}
```

View File

@@ -42,10 +42,12 @@ API 内部的日志将会使用此标签进行打印。
```kotlin
// 通过 configs 方法
YukiReflection.configs {
debugTag = "YourCustomTag"
debugLog {
tag = "YourCustomTag"
}
}
// 直接设置
YukiReflection.Configs.debugTag = "YourCustomTag"
YLog.Configs.tag = "YourCustomTag"
```
### 启用或禁用 Debug 模式
@@ -76,10 +78,12 @@ YukiReflection.Configs.isDebug = true
```kotlin
// 通过 configs 方法
YukiReflection.configs {
isEnableLogs = true
debugLog {
isEnable = true
}
}
// 直接设置
YukiReflection.Configs.isEnableLogs = true
YLog.Configs.isEnable = true
```
### 使用 configs 方法配置
@@ -90,9 +94,11 @@ YukiReflection.Configs.isEnableLogs = true
```kotlin
YukiReflection.configs {
debugTag = "YourCustomTag"
debugLog {
tag = "YourCustomTag"
isEnable = true
}
isDebug = true
isEnableLogs = true
}
```