🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

pastel-logger

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pastel-logger

simple logging utility

1.0.3
latest
Source
npm
Version published
Weekly downloads
1
-83.33%
Maintainers
0
Weekly downloads
 
Created
Source

Import

import { Logger } from "pastel-logger";

Initialization

// system timezone
const logger = new Logger();

// custom timezone
const logger = new Logger({ tz: "Asia/Calcutta" });

// custom time string format
const logger = new Logger({ format: "DD-MM-YYYY hh:mm:ss" });

Usage

import { Logger } from "pastel-logger";

const logger = new Logger();

// general methods
logger.log("This is a log message");
logger.debug("This is a debug message");
logger.warn("This is a warning message");
logger.error("This is an error message");
logger.info("This is an info message");
logger.success("This is a success message");

// log levels
logger.log("This is a debug message", "debug");
logger.log("This is a warning message", "warn");
logger.log("This is an error message", "error");
logger.log("This is an info message", "info");
logger.log("This is a success message", "success");

// custom color (hex)
logger.log("This is a log message", "#694200");

// disable bold text
// all logs are bold by default (except logger#blank)
// but if you need a custom colored text without bold:
logger.log("This is a log message", "#694200", false);

// blank (possibly hides on most terminals, avoiding attention)
// useful for logs that aren't a priority over other logs
// but doesn't mean they should be excluded altogether
logger.blank("This is a log message");

FAQs

Package last updated on 20 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts