0.2.2 • Published 2 months ago

lightlogging v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Light Logging

GitHub

Description

A lightweight logging library for Node.js applications with optional colorization and file output.

Installation

npm install lightlogging

or with yarn:

yarn add lightlogging

Usage

import Log from "lightlogging";

Log.info("Server running at http://localhost:3000");
Log.warn("isSomeFunction is deprecated.");
Log.error("Failed to connect to database.");

Config

Log.configure({
  logFilePath: false, // You can passa a boolean, case true will create a folder log in root project, or pass the path of a folder that you want to create the folders and files for logs
  icons: true, // To show icons on logs '✔ ⚠️  X'
  customColors: {
    info: "green", // Colors can be any of the supported colors
    error: "magenta",
    warn: "cyan",
  },
  timestamps: "all", // "all", "log-only", "none"
});

Default configs are:

Log.configure({
  logFilePath: false, // No file output
  icons: false,
  customColors: {
    info: "white",
    error: "red",
    warn: "yellow",
  },
  timestamps: "log-only",
});

Supported Colors

  • black, red, green, yellow, blue, magenta, cyan, white, gray
0.2.1

2 months ago

0.2.2

2 months ago

0.2.0

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago