Skip to content

Commit

Permalink
feat(APIM-344): fix 2 PR feedback items, change comment and var type
Browse files Browse the repository at this point in the history
  • Loading branch information
avaitonis committed Jul 25, 2023
1 parent 28195b1 commit da02c07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/helpers/redact-strings-in-log-args.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const redactStringsInLogArgs = (
redactLogs: boolean,
redactPaths: string[],
redactStrings: { searchValue: string | RegExp; replaceValue: string }[],
args: any,
args: any[],
): any => {
if (!redactLogs) {
return args;
Expand Down
2 changes: 1 addition & 1 deletion src/main.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { LoggingInterceptor } from './logging/logging-interceptor.helper';
},
},
hooks: {
logMethod(inputArgs: any, method) {
logMethod(inputArgs: any[], method) {
return method.apply(this, redactStringsInLogArgs(config.get<boolean>('app.redactLogs'), REDACT_STRING_PATHS, REDACT_STRINGS, inputArgs));
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { REDACT_STRINGS } from './constants';
import { ConsoleLoggerWithRedact } from './logging/console-logger-with-redact';

const main = async () => {
// If REDACT_LOGS is true use ConsoleLoggerWithRedact. ConsoleLoggerWithRedact is used just if `NestFactory.create` is fails completely.
// If REDACT_LOGS is true use ConsoleLoggerWithRedact. ConsoleLoggerWithRedact is used just if `NestFactory.create` fails completely.
// If `NestFactory.create` doesn't fail completely, then buffered logs are passed to PinoLogger. NestLogger and ConsoleLoggerWithRedact are not used.
const logger = process.env.REDACT_LOGS !== 'false' ? new ConsoleLoggerWithRedact(REDACT_STRINGS) : new NestLogger();
const nestApp: NestApplication = await NestFactory.create(MainModule, { logger, bufferLogs: true });
Expand Down

0 comments on commit da02c07

Please sign in to comment.