Skip to content

Commit e86389e

Browse files
committed
BreakRequest toLogContext
1 parent a9c13ea commit e86389e

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/main/kotlin/com/lambda/interaction/request/breaking/BreakRequest.kt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import com.lambda.config.groups.BuildConfig
2121
import com.lambda.config.groups.InteractionConfig
2222
import com.lambda.interaction.construction.context.BreakContext
2323
import com.lambda.interaction.construction.context.BuildContext
24+
import com.lambda.interaction.request.LogContext
25+
import com.lambda.interaction.request.LogContext.Companion.buildLogContext
2426
import com.lambda.interaction.request.Request
2527
import com.lambda.interaction.request.hotbar.HotbarConfig
2628
import com.lambda.interaction.request.inventory.InventoryConfig
@@ -40,7 +42,7 @@ data class BreakRequest(
4042
val rotation: RotationConfig = TaskFlowModule.rotation,
4143
val inventory: InventoryConfig = TaskFlowModule.inventory,
4244
val interact: InteractionConfig = TaskFlowModule.interaction
43-
) : Request() {
45+
) : Request(), LogContext {
4446
override val requestID = ++requestCount
4547

4648
override val config = build.breaking
@@ -58,6 +60,23 @@ data class BreakRequest(
5860
override fun submit(queueIfClosed: Boolean) =
5961
BreakManager.request(this, queueIfClosed)
6062

63+
override fun toLogContext() =
64+
buildLogContext {
65+
text("Break Request")
66+
pushTab()
67+
text("Request ID: $requestID")
68+
text("Contexts: ${contexts.size}")
69+
text("Callbacks:")
70+
pushTab()
71+
text("onStart: ${onStart != null}")
72+
text("onUpdate: ${onUpdate != null}")
73+
text("onStop: ${onStop != null}")
74+
text("onCancel: ${onCancel != null}")
75+
text("onItemDrop: ${onItemDrop != null}")
76+
text("onReBreakStart: ${onReBreakStart != null}")
77+
text("onReBreak: ${onReBreak != null}")
78+
}
79+
6180
@DslMarker
6281
annotation class BreakRequestBuilder
6382

src/main/kotlin/com/lambda/interaction/request/hotbar/HotbarRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class HotbarRequest(
4444

4545
override fun toLogContext() =
4646
buildLogContext {
47-
text("Hotbar Request")
47+
text("Hotbar Request:")
4848
pushTab()
4949
text("Request ID: $requestID")
5050
text("Slot: $slot")

0 commit comments

Comments
 (0)