1.0.2 • Published 6 years ago

iog-browser v1.0.2

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

iog

Log for browser.

Installation

npm install --save iog-browser

Example

const Iog = require('iog-browser');

const logger = new Iog('my-module-name');

logger.write('my log info');
logger.write({
    also: {
        you: 'want, for example an object'
    }
});

Log format

this produces

logger.write('my log info');

this in your console

[A-CONTEXT][LOG] my log info

API

Iog

Kind: global class

new Iog(contextName, opts)

Iog instance

iog.pause() ⇒ Iog

Pause log writing

Kind: instance method of Iog

iog.resume() ⇒ Iog

Resume log writing

Kind: instance method of Iog

iog.write(msg, type)

Write log

Kind: instance method of Iog

iog.error(msg)

A wrapper of write that set type to "error"

Kind: instance method of Iog

iog.warn(msg)

A wrapper of write that set type to "warn"

Kind: instance method of Iog

iog.info(msg)

A wrapper of write that set type to "info"

Kind: instance method of Iog

iog.trace(msg)

A wrapper of write that set type to "trace"

Kind: instance method of Iog

License

iog-browser is open-sourced software licensed under the MIT license

Author

Fabio Ricali