From 5dc2cc405fe4cb55a9d8ac0ef83adbbf2712393a Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Sun, 6 Apr 2025 15:20:17 +0530 Subject: [PATCH] add log configuration variables --- packages/conf/DittoConf.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/conf/DittoConf.ts b/packages/conf/DittoConf.ts index 59a3fde4..8373a5b6 100644 --- a/packages/conf/DittoConf.ts +++ b/packages/conf/DittoConf.ts @@ -238,6 +238,19 @@ export class DittoConf { }; } + get isCI() { + return this.env.get('CI') === 'true'; + } + + get logConfig() { + const [fmt = 'jsonl', level = 'debug', scopes = ''] = (this.env.get('DEBUG') || '').split(':'); + return { + fmt, + level, + scopes: scopes.split(',').filter(Boolean), + }; + } + /** nostr.build API endpoint when the `nostrbuild` uploader is used. */ get nostrbuildEndpoint(): string { return this.env.get('NOSTRBUILD_ENDPOINT') || 'https://nostr.build/api/v2/upload/files';