mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-06 17:34:32 +02:00
fix(bridge): chunked logs
This commit is contained in:
parent
fbd683251a
commit
9b10573eb1
@ -118,7 +118,11 @@ class BridgeClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun broadcastLog(tag: String, level: String, message: String) {
|
fun broadcastLog(tag: String, level: String, message: String) {
|
||||||
safeServiceCall { service.broadcastLog(tag, level, message) }
|
message.chunked(1024 * 256).forEach {
|
||||||
|
safeServiceCall {
|
||||||
|
service.broadcastLog(tag, level, it)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: use interfaces instead of direct file access
|
//TODO: use interfaces instead of direct file access
|
||||||
|
@ -167,7 +167,7 @@ class ComposerHooks: Feature("ComposerHooks", loadParams = FeatureLoadParams.ACT
|
|||||||
"log" -> {
|
"log" -> {
|
||||||
if (argc < 3) return false
|
if (argc < 3) return false
|
||||||
val logLevel = composerMarshaller.getUntyped(1) as? String ?: return false
|
val logLevel = composerMarshaller.getUntyped(1) as? String ?: return false
|
||||||
val message = (composerMarshaller.getUntyped(2) as? String)?.takeIf { it.length < 1024 * 512 } ?: return false
|
val message = composerMarshaller.getUntyped(2) as? String ?: return false
|
||||||
|
|
||||||
val tag = "ComposerLogs"
|
val tag = "ComposerLogs"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user