diff --git a/lib/logger/index.spec.ts b/lib/logger/index.spec.ts index 9b66e5c4c41fd1b4e305384aff3be08b400d6bce..a6c8368e8e14153573fdfafb2df2faccc78cf0d1 100644 --- a/lib/logger/index.spec.ts +++ b/lib/logger/index.spec.ts @@ -160,13 +160,14 @@ describe('logger/index', () => { constructor(public field: string) {} } + const prBody = 'test'; logger.error({ foo: 'secret"password', bar: ['somethingelse', 'secret"password'], npmToken: 'token', buffer: Buffer.from('test'), content: 'test', - prBody: 'test', + prBody, secrets: { foo: 'barsecret', }, @@ -181,7 +182,7 @@ describe('logger/index', () => { expect(logged.npmToken).not.toBe('token'); expect(logged.buffer).toBe('[content]'); expect(logged.content).toBe('[content]'); - expect(logged.prBody).toBe('[Template]'); + expect(logged.prBody).toBe(prBody); expect(logged.secrets.foo).toBe('***********'); expect(logged.someFn).toBe('[function]'); expect(logged.someObject.field).toBe('**redacted**'); diff --git a/lib/logger/utils.ts b/lib/logger/utils.ts index d797fbe59a3469aaebef18a012b50455fe0e3f05..90e0e263f76510c6ab69398e23cfa71b33f7b31f 100644 --- a/lib/logger/utils.ts +++ b/lib/logger/utils.ts @@ -39,7 +39,7 @@ export class ProblemStream extends Stream { this._problems = []; } } -const templateFields = ['prBody']; + const contentFields = [ 'content', 'contents', @@ -148,8 +148,6 @@ export function sanitizeValue( curValue = '***********'; } else if (contentFields.includes(key)) { curValue = '[content]'; - } else if (templateFields.includes(key)) { - curValue = '[Template]'; } else if (key === 'secrets') { curValue = {}; Object.keys(val).forEach((secretKey) => { diff --git a/tools/docs/config.ts b/tools/docs/config.ts index 110773c666440decf53b7f56d0f56765b7845b0d..d4c5a2a00700dfe165e30365c88bac5427999339 100644 --- a/tools/docs/config.ts +++ b/tools/docs/config.ts @@ -116,9 +116,6 @@ function genTable(obj: [string, string][], type: string, def: any): string { ) { el[1] = `<code>${el[1]}</code>`; } - if (type === 'string' && el[0] === 'default' && el[1].length > 200) { - el[1] = `[template]`; - } // objects and arrays should be printed in JSON notation if ((type === 'object' || type === 'array') && el[0] === 'default') { // only show array and object defaults if they are not null and are not empty