refactor: logger cmdSerializer

This commit is contained in:
Rhys Arkins 2019-04-09 12:23:56 +02:00
parent 30a67fe43c
commit 7bc2f157ee
2 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,6 @@
module.exports = cmdSerializer;
// istanbul ignore next
function cmdSerializer(cmd) {
return cmd.replace(/https:\/\/[^@]*@/g, 'https://**redacted**@');
}

View file

@ -3,15 +3,11 @@ const bunyan = require('bunyan');
const PrettyStdout = require('./pretty-stdout').RenovateStream; const PrettyStdout = require('./pretty-stdout').RenovateStream;
const configSerializer = require('./config-serializer'); const configSerializer = require('./config-serializer');
const errSerializer = require('./err-serializer'); const errSerializer = require('./err-serializer');
const cmdSerializer = require('./cmd-serializer');
let bunyanLogger; let bunyanLogger;
let meta = {}; let meta = {};
// istanbul ignore next
function cmdSerializer(cmd) {
return cmd.replace(/https:\/\/[^@]*@/g, 'https://**redacted**@');
}
function initLogger() { function initLogger() {
const stdout = { const stdout = {
name: 'stdout', name: 'stdout',