mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 12:17:37 +00:00
feat(logging): add timestamp (#48)
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
+3
-1
@@ -1,11 +1,13 @@
|
||||
import winston, {format} from 'winston';
|
||||
|
||||
const prettyJson = format.printf(info => {
|
||||
const timestamp = new Date().toLocaleTimeString();
|
||||
|
||||
if (typeof info.message === 'object') {
|
||||
info.message = JSON.stringify(info.message, null, 4);
|
||||
}
|
||||
|
||||
return `${info.level} :: ${info.message}`;
|
||||
return `[${timestamp}] ${info.level} :: ${info.message}`;
|
||||
});
|
||||
|
||||
export const Logger = winston.createLogger({
|
||||
|
||||
Reference in New Issue
Block a user