Skip to content
The logger we use @ faable.com based in debug module
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
test
.gitignore
README.md
package.json
tsconfig.json
yarn.lock

README.md

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("@faable/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("@faable/flogg");
debug("¡Hi!");

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

api:debug:miscroscope ¡Hi!
You can’t perform that action at this time.