refactor: replace console.log/warn/error with file-based log() for silent logging

Replace all console output with shared logger to write to
/tmp/oh-my-opencode.log instead of stdout/stderr.

Files changed:
- index.ts: console.warn → log()
- hook-message-injector/injector.ts: console.warn → log()
- lsp/client.ts: console.error → log()
- ast-grep/downloader.ts: console.log/error → log()
- session-recovery/index.ts: console.error → log()
- comment-checker/downloader.ts: console.log/error → log()

CLI tools (install.ts, doctor, etc.) retain console output for UX.
This commit is contained in:
justsisyphus
2026-01-30 12:45:37 +09:00
parent df9004d6f7
commit 493b20394b
6 changed files with 17 additions and 12 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ import {
stripThinkingParts,
} from "./storage"
import type { MessageData, ResumeConfig } from "./types"
import { log } from "../../shared/logger"
export interface SessionRecoveryOptions {
experimental?: ExperimentalConfig
@@ -414,7 +415,7 @@ export function createSessionRecoveryHook(ctx: PluginInput, options?: SessionRec
return success
} catch (err) {
console.error("[session-recovery] Recovery failed:", err)
log("[session-recovery] Recovery failed:", err)
return false
} finally {
processingErrors.delete(assistantMsgID)