Refine CLI args and lifecycle logging

This commit is contained in:
Shantur Rathore
2025-11-17 22:08:50 +00:00
parent 40e8c90bab
commit a3f02befa7
7 changed files with 1505 additions and 33 deletions

View File

@@ -30,7 +30,7 @@ export class BinaryRegistry {
}
create(request: BinaryCreateRequest): BinaryRecord {
this.logger.info({ path: request.path }, "Registering OpenCode binary")
this.logger.debug({ path: request.path }, "Registering OpenCode binary")
const entry = {
path: request.path,
version: undefined,
@@ -56,7 +56,7 @@ export class BinaryRegistry {
}
update(id: string, updates: BinaryUpdateRequest): BinaryRecord {
this.logger.info({ id }, "Updating OpenCode binary")
this.logger.debug({ id }, "Updating OpenCode binary")
const config = this.configStore.get()
const updatedEntries = config.opencodeBinaries.map((binary) =>
binary.path === id ? { ...binary, label: updates.label ?? binary.label } : binary,
@@ -77,7 +77,7 @@ export class BinaryRegistry {
}
remove(id: string) {
this.logger.info({ id }, "Removing OpenCode binary")
this.logger.debug({ id }, "Removing OpenCode binary")
const config = this.configStore.get()
const remaining = config.opencodeBinaries.filter((binary) => binary.path !== id)
const update: ConfigFileUpdate = { opencodeBinaries: remaining }

View File

@@ -35,7 +35,7 @@ export class ConfigStore {
this.logger.debug({ resolved }, "Loaded existing config file")
} else {
this.cache = DEFAULT_CONFIG
this.logger.info({ resolved }, "No config file found, using defaults")
this.logger.debug({ resolved }, "No config file found, using defaults")
}
} catch (error) {
this.logger.warn({ err: error }, "Failed to load config, using defaults")
@@ -59,7 +59,7 @@ export class ConfigStore {
this.cache = ConfigFileSchema.parse(merged)
this.persist()
this.eventBus?.publish({ type: "config.appChanged", config: this.cache })
this.logger.info("Config updated")
this.logger.debug("Config updated")
}
private mergeConfig(current: ConfigFile, partial: ConfigFile | ConfigFileUpdate): ConfigFile {