1.2.2 • Published 6 years ago

@barmaglot/logger v1.2.2

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

barmaglot-logger

IT DOESN'T WORK PROPERLY YET

Barmaglot/logger is a light-weight logging util which also includes some additional stuff created for personal needs. It's pretty easy configurable, but it also has limited capabilities, and that's why you probably wanna use something more stable, like log4js or winston

Logger:

Usage

npm i --save @barmaglot/logger

var bl = require("@barmaglot/logger");
bl.configure();

var logger = bl.getLoggerForFile(__filename);

Configuration

Config-object requires only an array of appenders, and looks something like this:

{
    appenders: [ ... ]
}

Config isn't required. Default config object looks like this:

{
    appenders: [{
        target: {
            type: "console"
        },
        format: "[%p] %d %m:%l",
        level: {
            min: "info",
            max: "error"
        }
    }]
}

Appender config:

  • target: only one required option. Includes type field and some additional options depends on type value. Target types: console: doesn't need any additional options file: requires filepath option, which must include path to target file * url: requires url option, which must include url to server logging method

  • format: not required Can include next placeholders: %p: log level (info, trace, debug etc.) %d: date (now only in HH/MM/SS:MMM format) %m: log message %l: line number

  • level: not required. Determines lowest and highest allowed log-levels for current appender Includes two fields: min max

Log-levels order: info, debug, trace, warn, error, fatal

Utils

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago