Fixes related to config loader

This commit is contained in:
2025-07-15 14:39:33 -05:00
parent 9b25a964f7
commit fef71122cf
4 changed files with 11 additions and 6 deletions

View File

@@ -7,7 +7,15 @@ export const CommonConfigSchema = z.object({
serviceName: z.string().default('llm-observability-mcp'),
serviceVersion: z.string().default('1.0.0'),
environment: z.string().default('development'),
debug: z.boolean().default(false),
debug: z
.preprocess((val) => {
if (typeof val === 'string') {
if (val.toLowerCase() === 'false') return false;
if (val.toLowerCase() === 'true') return true;
}
return val;
}, z.boolean())
.default(false),
logLevel: z.enum(['debug', 'info', 'warn', 'error']).default('info'),
});