npm.io
1.0.9 • Published 2 months ago

ps-logger

Licence
MIT
Version
1.0.9
Deps
0
Size
15 kB
Vulns
0
Weekly
0
Stars
4

ps-logger

screenshot
  • Npm package total downloads

  • imshivanshpatel

shivansh-patel-4915b4171 programming_updates

  • ps-logger is a production grade logger for info, warning, error, silly, verbose, prompt, debug, and magenta messages, with file logging and scrolling terminal text support.

More Products to checkout

Timez Timer & Pomodoro
Timez Timer & Pomodoro
"Timez Timer & Pomodoro" is a Chrome extension designed to enhance focus and productivity. Set multiple timers within the extension to break down your tasks, manage your time effectively, and achieve your goals. Additionally, you can use the Pomodoro feature to work and have a break in a more planned way

Open →
Syncboard Clipboard Manager
Syncboard Clipboard Manager
SyncBoard is a powerful clipboard management extension that seamlessly syncs your clipboard data across all your devices. Effortlessly copy, organize, and access your clipboard history anywhere, boosting your productivity and ensuring you never lose important information.

Open →

File logger added

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");
logger.magenta("This message is magenta");
Scrolling terminal text

Use scrollingText to continuously scroll text across the terminal. The optional second argument sets the text color to one of the available colorsObj keys.

logger.scrollingText("Your server is running", "cyan");

Available colors are red, yellow, brightYellow, green, blue, magenta, and cyan.

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")

Keywords