This package has been deprecated

Author message:

This package has been deprecated, more info at https://faable.com/

@faable/flogg
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

Flogg - Faable logger for node

npm version npm install

Faable.com logger for node.js that uses debug module and customizes it for log file scoping.

How to use it

In package.json set the DEBUG env variable:

{
    ...
    "scripts":{
        "dev":"DEBUG=api:* node myapp.js"
    }
    ...
}

Then before doing anything require flog and set the log prefix:

const { setLog } = require("../dist/flogg");

// setLog should be called only once
setLog("api");

In all other files, just require flogg and it will set automatically the log prefix based on filename. Example for a file named microscope.js:

const { debug } = require("../dist/flogg");
debug("¡Hi!");

This code will print if DEBUG env variable is set to api:*:

api:debug:miscroscope ¡Hi!

Readme

Keywords

none

Package Sidebar

Install

npm i @faable/flogg

Weekly Downloads

13

Version

1.1.5

License

ISC

Unpacked Size

5.67 kB

Total Files

12

Last publish

Collaborators

  • boyander