fix(quartz): send JVM PlatformLog output to stderr

On the JVM, Log.d / .i / .w / .e were printing through \`println()\` which
lands on stdout. The amy CLI uses stdout as its JSON contract — any
Marmot/MLS command would restore state, emit a burst of DEBUG lines,
then emit the JSON object, and every caller piping through jq failed
to parse because the first non-empty line was a log line.

Switch to \`System.err.println\` inside PlatformLog.jvm.kt. Conventional
for CLIs (data on stdout, diagnostics on stderr), and the desktop app
already redirects as part of packaging. Callers who want everything
mixed can still \`2>&1\` at the shell level.

Fixes amy marmot group create / group add / message send etc. when
their output is captured by a shell script.

https://claude.ai/code/session_01M6dCKAF5Y1VyHGZPjzwDXq
This commit is contained in:
Claude
2026-04-21 22:38:38 +00:00
parent 020abccf57
commit 25781a8815
@@ -34,10 +34,14 @@ actual object PlatformLog {
message: String,
throwable: Throwable?,
) {
// Diagnostics go to stderr so callers that pipe stdout (the CLI uses
// stdout for its JSON contract, desktop apps may too) aren't corrupted
// by log interleaving. Consumers that prefer stdout can just redirect
// 2>&1 at the shell level.
if (throwable != null) {
println("${time()} $level: [$tag] $message. Throwable: ${throwable.message}")
System.err.println("${time()} $level: [$tag] $message. Throwable: ${throwable.message}")
} else {
println("${time()} $level: [$tag] $message")
System.err.println("${time()} $level: [$tag] $message")
}
}