starless-logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Starless Logger

A simple logging library for Node.js.

Installation

You can install the package via npm:

npm install starless-logger

Usage

Import the package and call the log function with a message and an optional log level:

const { log } = require("starless-logger");

log("Hello, world!"); // logs "[timestamp] [INFO] Hello, world!" in green
log("Warning message", "warn"); // logs "[timestamp] [WARN] Warning message" in yellow
log("Error message", "error"); // logs "[timestamp] [ERROR] Error message" in red

The log function takes two arguments: message (string) and level (optional string). If level is not provided, the default value is "info". Valid values for level are "info", "warn", and "error".

Examples

const { log } = require("starless-logger");

log("Starting server...", "info");
log("Connection lost!", "warn");
log("Failed to authenticate user", "error");

Readme

Keywords

none

Package Sidebar

Install

npm i starless-logger

Weekly Downloads

0

Version

1.0.5

License

ISC

Unpacked Size

3.02 kB

Total Files

4

Last publish

Collaborators

  • jst_htet