Skip to content

Latest commit

 

History

History

slf4ts-loglevel

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

slf4ts-loglevel

loglevel Logging-Binding for slf4ts

NPM Version License Dependencies Status

It's meant to be used with nodejs.

Example Usage

Example package.json:

{
    ...,
    "dependencies": {
        "slf4ts-loglevel": "latest"
    },
    ...
}

Example code:

import { LoggerFactory, LoggerConfiguration } from "slf4ts-api";

const ROOT_LOGGER = LoggerFactory.getLogger();
ROOT_LOGGER.setMetadata({ application: 'my-app' });

/**
 * prints something like:
 * 
 *      Test Message { version: '1.0.0' } { application: 'my-app' } Error: 
 *          at Object.<anonymous> ...
 * 
 * Note that all metadata are an extra object passed to the log-method.
 */
ROOT_LOGGER.info("Test Message", { version: '1.0.0' }, new Error());

License

MIT