1.0.8 • Published 1 year ago

ps-logger v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ps-logger

  • Npm package total downloads

  • ps-logger is a production grade logger, basically it is used for logging info,warning,error,silly,verbose,prompt and debug statements

File logger added in this release (1.0.7)

usage examples:-

const logger=require('ps-logger');

logger.info("This is info")
logger.warn("This is warning");
logger.error("This is error");
logger.debug("This is debug");
logger.prompt("This is prompt");
logger.verbose("This is verbose");
logger.silly("This is silly");

disabling or enabling color

  • By default it is set to true,so you dont need to set it as true
logger.setColor(false);

In TypeScript

import {info} from "ps-logger";

info(`server is running on port ${port} `)

File Logging

const { logToFile,info } = require("ps-logger");

// set it to `true` to log into the file

// second param is file name and it's optional if you don't pass file name then it will log into ps-logger.log file

logToFile(true,'todaysLog');


info("This will output into log file")
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago