Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50665 views
1
/*
2
* default-exceptions.js: A test fixture for logging exceptions with the default winston logger.
3
*
4
* (C) 2011 Charlie Robbins
5
* MIT LICENCE
6
*
7
*/
8
9
var path = require('path'),
10
winston = require('../../../lib/winston');
11
12
winston.handleExceptions([
13
new (winston.transports.File)({
14
filename: path.join(__dirname, '..', 'logs', 'default-exception.log'),
15
handleExceptions: true
16
})
17
]);
18
19
setTimeout(function () {
20
throw new Error('OH NOES! It failed!');
21
}, 1000);
22