mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-07 08:40:29 +03:00
Add logging and some code improvement
This commit is contained in:
6
app.js
6
app.js
@@ -4,7 +4,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
/* */
|
||||
const {createLogger, format, transports} = require('winston');
|
||||
const {combine, timestamp, printf, errors, prettyPrint} = format;
|
||||
const {combine, timestamp, printf, errors} = format;
|
||||
/* express and https */
|
||||
const ejs = require('ejs');
|
||||
const express = require('express');
|
||||
@@ -33,10 +33,8 @@ global.logger = createLogger({
|
||||
errors({stack: true}),
|
||||
timestamp(),
|
||||
printf(({level, message, timestamp, stack}) => {
|
||||
//console.dir(a, {depth: 9});
|
||||
return `${timestamp} ${level}: ${stack != undefined ? stack : message}`;
|
||||
})
|
||||
// prettyPrint()
|
||||
}),
|
||||
),
|
||||
transports: [
|
||||
new transports.Console({
|
||||
|
Reference in New Issue
Block a user