diff --git a/packages/logger/package.json b/packages/logger/package.json index b90622d..1571c86 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@tshio/logger", - "version": "1.0.3", + "version": "1.0.4", "repository": { "type": "git", "url": "https://github.com/TheSoftwareHouse/node-common.git" diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index d358978..93444f2 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -1,3 +1,3 @@ export * from "./logger"; export * from "./logger.types"; -export * from "./restrict-from-production" +export * from "./restrict-from-production"; diff --git a/packages/logger/src/logger.ts b/packages/logger/src/logger.ts index c8a5812..e51f742 100644 --- a/packages/logger/src/logger.ts +++ b/packages/logger/src/logger.ts @@ -44,7 +44,7 @@ const logFormat = ( }); }); -export const createLogger = (keysToHide: string[], env = process.env) => +export const createLogger = (env = process.env, keysToHide?: string[]) => winston.createLogger({ level: env.LOGGING_LEVEL || "debug", format: winston.format.combine(winston.format.splat(), logFormat(env, keysToHide)), diff --git a/packages/logger/src/tests/logger.spec.ts b/packages/logger/src/tests/logger.spec.ts index e4e0d50..855eb02 100644 --- a/packages/logger/src/tests/logger.spec.ts +++ b/packages/logger/src/tests/logger.spec.ts @@ -3,7 +3,7 @@ import { createLogger } from ".."; describe("logger", () => { it("Check logger format", async () => { - const winstonLogger = createLogger(["secure"]); + const winstonLogger = createLogger(process.env, ["secure"]); class Circular { constructor() {