xdk-log
@accedo/xdk-log
This is the logger used by all XDK modules. It takes a prefix and generate a set of bound console function.
The logger does respect the console.level
from XDK config.
Instalation
$ npm i @accedo/xdk-log @accedo/xdk-log-loger-onscreen
Configuration
xdk.config.js
import { LOG_LEVELS } from '@accedo/xdk-log';
import transport from '@accedo/xdk-log-logger-onscreen';
export default {
// ...
logging: {
transport,
level: LOG_LEVELS.INFO,
verbose: {
TVKey: true,
ConnectionPoller: false,
Player: true
}
// other transport config
}
};
Usage
import logger from '@accedo/xdk-log';
const { logError, warn, log, info, debug } = logger('[demo]');
logError(`foo bar`); // '[demo] foo bar' will be logged at error level.