Skip to content

Commit

Permalink
Move logger to named export
Browse files Browse the repository at this point in the history
  • Loading branch information
prathap-safe committed Aug 30, 2022
1 parent 712fa89 commit 2fa493d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import winston from "winston";

const { combine, errors, timestamp, splat, json } = winston.format;

const logger = winston.createLogger({
export const logger = winston.createLogger({

// default log level is "info"
level: "info",
Expand Down Expand Up @@ -39,5 +39,3 @@ const logger = winston.createLogger({
// generic metadata applied to all logs
defaultMeta: { type: "application" }
});

export default logger;
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const logger = require("logger-safe-security").default;
const { logger } = require("logger-safe-security").default;
const appLogger = logger.child({ service: "sample" });

logger.info("This is a parent logger");
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logger from "logger-safe-security";
import { logger } from "logger-safe-security";
const appLogger = logger.child({ service: "sample" });

logger.info("This is a parent logger");
Expand Down

0 comments on commit 2fa493d

Please sign in to comment.