Enable nim-waku trace logs

This commit is contained in:
Franck Royer 2021-04-09 11:23:00 +10:00
parent 27540fae47
commit 78292c471a
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 16 additions and 1 deletions

View File

@ -29,6 +29,17 @@ export interface Args {
rpcAdmin?: boolean; rpcAdmin?: boolean;
nodekey?: string; nodekey?: string;
portsShift?: number; portsShift?: number;
logLevel?: LogLevel;
}
export enum LogLevel {
Error = 'error',
Info = 'info',
Warn = 'warn',
Debug = 'debug',
Trace = 'trace',
Notice = 'notice',
Fatal = 'fatal',
} }
export class NimWaku { export class NimWaku {
@ -61,7 +72,11 @@ export class NimWaku {
const mergedArgs = defaultArgs(); const mergedArgs = defaultArgs();
// Object.assign overrides the properties with the source (if there are conflicts) // Object.assign overrides the properties with the source (if there are conflicts)
Object.assign(mergedArgs, { portsShift: this.portsShift }, args); Object.assign(
mergedArgs,
{ portsShift: this.portsShift, logLevel: LogLevel.Trace },
args
);
const argsArray = argsToArray(mergedArgs); const argsArray = argsToArray(mergedArgs);
this.process = spawn(NIM_WAKU_BIN, argsArray, { this.process = spawn(NIM_WAKU_BIN, argsArray, {