Changelog: Setup & Foundation - bcoin - express - mongo - eslint - logging Status: Bcoin syncs over network, uses a local leveldb to store blocks and checkpoints. Block event saves data to mongo. Express endpoint for block hashes, stubbed to reply with blockhashes until mongo models are finalized. ToDo: Move config out of code
18 lines
365 B
JavaScript
18 lines
365 B
JavaScript
const winston = require('winston');
|
|
const logfile = new Date().toISOString();
|
|
|
|
const logger = new (winston.Logger)({
|
|
transports: [
|
|
new (winston.transports.Console)({
|
|
timestamp: true,
|
|
}),
|
|
new (winston.transports.File)({
|
|
filename: `logs/${logfile}.log`,
|
|
}),
|
|
],
|
|
});
|
|
|
|
logger.level = process.env.LOG || 'debug';
|
|
|
|
module.exports = logger;
|