test: Configure logging level via LOGLEVEL environment variable.

This commit is contained in:
Ruben Verborgh 2020-12-20 15:20:29 +01:00
parent bd7e49351b
commit 79ba500f5a

View File

@ -1,8 +1,9 @@
import { setGlobalLoggerFactory } from '../../src/logging/LogUtil';
import { VoidLoggerFactory } from '../../src/logging/VoidLoggerFactory';
import { WinstonLoggerFactory } from '../../src/logging/WinstonLoggerFactory';
// Set the main logger
const loggerFactory = new VoidLoggerFactory();
const level = process.env.LOGLEVEL ?? 'off';
const loggerFactory = new WinstonLoggerFactory(level);
setGlobalLoggerFactory(loggerFactory);
// Also set the logger factory of transpiled JS modules