2.0.2 • Published 6 years ago

dstv-logger v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

dstv-logger

Log things, prefixed with a timestamp

Usage

var dstvLogger = require('dstv-logger');

var config = {
ipAddress : '0.0.0.0',
OS : 'Samsung Smart TV',
appVersion : '2.5.1'
};

var logger = new dstvLogger(config);

logger.event('BITRATE CHANGE', '720p');
// [18:10:56] { key: 'BITRATE CHANGE', value: '720p' }

logger.log('a message');
// [16:27:02] a message

logger.error('ooops!');
// [16:27:02] ooops!

API

logger.log(msg...)

Logs the message as if you called console.log but prefixes the output with the current time in HH:MM:ss format.

logger.error(msg...)

Logs the message as if you called console.error but prefixes the output with the current time in HH:MM:ss format.

logger.warn(msg...)

Logs the message as if you called console.warn but prefixes the output with the current time in HH:MM:ss format.

logger.info(msg...)

Logs the message as if you called console.info but prefixes the output with the current time in HH:MM:ss format.

logger.event(key, value)

Logs player (QOS) specific events such as pause, play, bitrate change, etc

License

MIT