Import
import {Logoid, LogoidOption, BroadcastRestApiOption,
BroadcastIndexedDbOption, LogLevel, HttpRequest} from './index';
Install Logoid
const log = new Logoid();
log.installBroadcasts({
broadCastRestApi: {
httpRequest: {
url: 'http://localhost:4200/api',
method: 'POST'
},
watch: [LogLevel.ERROR]
},
broadcastIndexedDb: {
watch: [LogLevel.INFO, LogLevel.ERROR]
}
})
Console Log
log.log('welcome to logoid');
try{
log.error('error message', new Error('custom error'));
} catch(e){
//
}