fix(rootLogger): Only set a regex if there are redactions given, otherwise everything gets redacted
Signed-off-by: Harry Hogg <hhogg@spotify.com>
This commit is contained in:
@@ -34,10 +34,12 @@ export function setRootLogger(newLogger: winston.Logger) {
|
||||
}
|
||||
|
||||
export function setRootLoggerRedactionList(redactionList: string[]) {
|
||||
redactionRegExp = new RegExp(
|
||||
`(${redactionList.map(escapeRegExp).join('|')})`,
|
||||
'g',
|
||||
);
|
||||
if (redactionList.length) {
|
||||
redactionRegExp = new RegExp(
|
||||
`(${redactionList.map(escapeRegExp).join('|')})`,
|
||||
'g',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user