From a66ad2e2af3d4ffd0a7ab125215e7ed3c3325452 Mon Sep 17 00:00:00 2001 From: Juliette Love Date: Sun, 20 Apr 2025 20:20:40 +0100 Subject: Simple debug mode for CLI side (#66) * Adds debug mode config flag. * Wire through debug lines * Add debug mode logging example * Run format * Run format again --- packages/server/src/config/config.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'packages/server/src') diff --git a/packages/server/src/config/config.ts b/packages/server/src/config/config.ts index 86cd7a6c..bd698cf6 100644 --- a/packages/server/src/config/config.ts +++ b/packages/server/src/config/config.ts @@ -13,11 +13,18 @@ export class Config { private apiKey: string; private model: string; private targetDir: string; + private debugMode: boolean; - constructor(apiKey: string, model: string, targetDir: string) { + constructor( + apiKey: string, + model: string, + targetDir: string, + debugMode: boolean, + ) { this.apiKey = apiKey; this.model = model; this.targetDir = targetDir; + this.debugMode = debugMode; } getApiKey(): string { @@ -31,6 +38,10 @@ export class Config { getTargetDir(): string { return this.targetDir; } + + getDebugMode(): boolean { + return this.debugMode; + } } function findEnvFile(startDir: string): string | null { @@ -60,6 +71,7 @@ export function createServerConfig( apiKey: string, model: string, targetDir: string, + debugMode: boolean, ): Config { - return new Config(apiKey, model, path.resolve(targetDir)); + return new Config(apiKey, model, path.resolve(targetDir), debugMode); } -- cgit v1.2.3