chore: createOpencodeServer expose logLevel (#6202)

This commit is contained in:
Ayush Walekar
2025-12-26 11:09:06 -06:00
committed by GitHub
parent f1ab427f0e
commit 155ba794cf
5 changed files with 17 additions and 2 deletions
+4
View File
@@ -1174,6 +1174,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/
+4 -1
View File
@@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
options ?? {},
)
const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`]
if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`)
const proc = spawn(`opencode`, args, {
signal: options.signal,
env: {
...process.env,
+4
View File
@@ -1406,6 +1406,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/
+4 -1
View File
@@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
options ?? {},
)
const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`]
if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`)
const proc = spawn(`opencode`, args, {
signal: options.signal,
env: {
...process.env,