Skip to content

LeanyLabs/logger

Repository files navigation

Usage

You have two ways to use the lib:

  1. With default env variables name (which are: LOGGING_LEVEL, SERVICE_NAME and isProd which depends on NODE_ENV either including partial string 'prod' or not), the values of the variables must be defined in your process enviroment
const { logger } = require("@leanylabs/logger");

logger.info("hello world");
  1. Pass the needed variables manually into initially imported function 'createLogger' and then by means of in create the logger itself
const { createLogger } = require("@leanylabs/logger");

const logger = createLogger({
  isProduction: false,
  level: "silly",
  labels: {
    serviceName: "test",
  },
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published