artis

Logging library

Usage no npm install needed!

<script type="module">
  import artis from 'https://cdn.skypack.dev/artis';
</script>

README

Artis

JavaScript logging library

The primary focus of this project is to create a simple to use but advanced logging library, while still trying to keep the package as lightweight as possible without compromising on essential features.

Usage

Download the minfied library and include it in your HTML, or install and import it as a module in your projects.

<script src="https://cdn.jsdelivr.net/npm/artis/dist/artis.umd.min.js"></script>

The code below create a simple Node/Browser console logger:

// create a logger
const logger = artis.createLogger('sample', {
    level: artis.Level.INFO,
    history: true,
    transports: [
        // console transport
        new artis.transports.Console({
            format: '{d:yyyy-mm-dd HH:MM:ss.l} [{n}] [{l}]: {m}'
        })
    ]
});

logger.info('This is an object: %o', {hello: 'World'});
// output: 2018-12-14 20:58:24.623 [sample] [error]: This is an object: { hello: World }

logger.warn('Complex %s is %s', 'formatting', 'great!');
// output: 2018-12-14 20:58:24.633 [sample] [warn]: Complex formatting is great!

logger.debug('Position: %f, %f, %f', 10, 15.1, 20.5);
// output: 2018-12-14 20:58:24.634 [sample] [debug]: Position: 10, 15.1, 20.5