Skip to content

acoll/babel-plugin-loginator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-loginator

This plugin transforms console statements to include some extra parameters.

Example

In

console.info('hello');

Out

console.info("[INFO ]", new Date().toISOString(), "[FILENAME:LINE_NUM]", "info");

Installation

npm install --save-dev acoll/babel-plugin-loginator

Usage

Via .babelrc

.babelrc

//without options
{
    "plugins": [
        "loginator"
    ]
}

//with options
{
    "plugins": [
        [
            "loginator",
            {
                "colors": true
            }
        ]
    ]
}

### Via CLI
```sh
babel --plugins loginator script.js

Options

colors

boolean, defaults to false.

When set to true, this will colorize the log level string using Marak/colors.js.

About

Babel plugin to transform console statements to include log-level, timestamp, file and line number.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors