New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

llogger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llogger

lame logger

latest
Source
npmnpm
Version
0.4.2
Version published
Maintainers
1
Created
Source

llogger (the lame logger)

This is yet another logger for nodejs. I departed from my previous experience with markdown friendly HTML tag names, along with the basic log functions I expect.

Stability

Using the Node.js stability index, this API is:

Stability: 2 - Unstable

Install

npm install llogger

Test (includes visual only tests that demonstrate each method)

Once installed (and you're in the logger/ directory):

npm test

Usage

// Assuming you want only 1 logger in your file, just create it
// (using the world's worst variable name).
var l = require("llogger").create();

// Standard logging methods with a bit of flavor added.
// Pretty much the same syntax as console.log().

l("normal log message"); // equivalent to l.log
l.log("normal log message");
l.warn("normal warn message");
l.error("normal error message");
// And why not have HTML tag based methods?
l.h1("Section header.");
l.h2("Sub-section header.");
l.h3("Sub-sub-section header.");
l.h4("Sub-sub-sub-section header.");
l.h5("Sub-sub-sub-sub-section header.");
l.h6("Sub-sub-sub-sub-sub-section header.");
l.li("List item.");
// Print an 80 character horizontal rule.
l.hr();

// Increase the indentation level for this logger.
l.indent();
l.li("This is now indented one level.");
l.log("log, warn, and error messages are immune to indentation.");
// Decrease the indentation level for this logger.
l.dedent();
l.li("No longer indented.");

// Turn on filename and linenumber display on this logger instance.
l.displayCallerInfo(true);
l.log("This will now display the module name and line number from where it is called.");
// Turn off filename and linenumber display on this logger instance.
l.displayCallerInfo(false);

// Tell a logger instance to be quiet.
l.quiet = true;
l("won't see this");

// Turn on filename and linenumber display globally across all loggers,
// overriding the logger instance setting.
require("llogger").globalDisplayCallerInfo(true);
// Turn off filename and linenumber display globally across all loggers,
// deferring to the logger instance setting.
require("llogger").globalDisplayCallerInfo(false);

Credits

Rarely is software created in a vacuum, and that includes this lame logger. In addition to the modules referenced in the package.json file, I give credit to:

  • Igor Urminček (nlogger at https://github.com/igo/nlogger) for how to get caller module name and line number.

Keywords

log

FAQs

Package last updated on 15 Mar 2015

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