only show extra params when they are actually present

This commit is contained in:
Siddharth Singh 2025-04-06 15:46:24 +05:30
parent 1b19ff415a
commit 8f51a9d6d7
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View file

@ -238,6 +238,13 @@ export class DittoConf {
}; };
} }
/**
* The logging configuration for the Ditto server. The config is derived from
* the DEBUG environment variable and it is parsed as follows:
*
* `DEBUG='<jsonl|pretty>:<minimum log level to show>:comma-separated scopes to show'`.
* If the scopes are empty (e.g. in 'pretty:warn:', then all scopes are shown.)
*/
get logConfig(): { get logConfig(): {
fmt: 'jsonl' | 'pretty'; fmt: 'jsonl' | 'pretty';
level: string; level: string;

View file

@ -72,6 +72,6 @@ export const createLogiHandler = (conf: DittoConf, defaultHandler: LogiHandler)
'color: unset', 'color: unset',
); );
console.log(remaining.map((itm) => pair(...itm)).join('\n')); if (remaining.length) console.log(remaining.map((itm) => pair(...itm)).join('\n'));
console.groupEnd(); console.groupEnd();
}; };