Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@swiftpost/logger

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swiftpost/logger

A simple console logger class with colors.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
0
Weekly downloads
 
Created
Source

@swiftpost/logger

A simple console logger with colors.

Installation

pnpm add @swiftpost/logger

Usage

import { Logger } from "@swiftpost/logger";

const logger = new Logger();

Scoping

You can scope the logger to a specific module or feature.

const logger = new Logger({ scope: "auth" });

Methods

info(message: string, ...args: any[])

Log an info message.

logger.info("This is an info message");
output

[12:00:00] INFO [auth]: This is an info message

warn(message: string, ...args: any[])

Log a warning message.

logger.warn("This is a warning message");
output

[12:00:00] WARN [auth]: This is a warning message

error(message: string, ...args: any[])

Log an error message.

logger.error("This is an error message");
output

[12:00:00] ERROR [auth]: This is an error message

debug(message: string, ...args: any[])

Log a debug message.

logger.debug("This is a debug message");
output

[12:00:00] DEBUG [auth]: This is a debug message

Keywords

logger

FAQs

Package last updated on 15 Nov 2024

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