New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pure-console-logger

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-console-logger

Yet another simple console logger

1.0.2
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

pure-console-logger

Version Downloads License

NPM

Yet antoher logger, nobody asked for.

Super simple & provides good human debugable logs to the console.

Easy to use, small focus - very useful for small "DIY" projects.

2021-10-28T08:37:53.458Z INFO: [MAIN] Starting server -
2021-10-28T08:37:53.541Z DEBUG: [SERVER] Server started and listening on port 3000 -

Usage

Usage example

A simple example how to use this module. Copied from here example.ts

import { Logger, setLoglevel } from "pure-console-logger";
const logger = new Logger(__filename);

setLoglevel("INFO"); // Sets the loglevel globally
logger.debug("This is not logged!")
logger.info(JSON.stringify({ foo: "bar" }));
logger.warn("This is a warning!", { meta: "data", appended: "to the log string" });
logger.error("Oops!");
logger.error(new Error("something bad happended"));

const loggerWithStaticInfo = new Logger("custom name", { user: "zuse" });
loggerWithStaticInfo.info("Goodbye!");

Loglevels

PRIONAMEEMOJI
1ERROR:no_entry_sign:
2WARN:warning:
3INFO:information_source:
4DEBUG:space_invader:

CONTRIBUTORS

Feel free to contribute - pull requests and issues are welcome :)

LICENSE

MIT License

SEE LICENSE FILE

Keywords

logger

FAQs

Package last updated on 28 Oct 2021

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