'use strict';

/**
 * Imports.
 */
const express = require('express');
const winston = require('winston');

/**
 * Constants declarations.
 */
const LISTEN_PORT = process.env.LISTEN_PORT || 5050;
const LOGGING_LEVEL = process.env.LOGGING_LEVEL || 'info';


/**
 * Dependencies initializations.
 */
const app = express();

// Logger:
app.locals.logger = new winston.Logger({
  transports: [
    new winston.transports.Console({ prettyPrint: true, colorize: true, level: LOGGING_LEVEL }),
  ],
  exceptionHandlers: [
    new winston.transports.Console({ prettyPrint: true, colorize: true }),
  ],
});
// Just a shortcut.
const logger = app.locals.logger;

app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.listen(LISTEN_PORT, () => {
  logger.info(`Blink is listening on port:${LISTEN_PORT} env:${app.get('env')}`);
});

module.exports = app;

@@ -195,27 +195,26 @@
 ;%0Aconst LOGG
-ING
+ER
 _LEVEL = pro
@@ -222,27 +222,26 @@
 ess.env.LOGG
-ING
+ER
 _LEVEL %7C%7C 'i
@@ -246,16 +246,85 @@
 'info';%0A
+const LOGGER_TIMESTAMP = !(process.env.LOGGER_TIMESTAMP === 'false');
 %0A%0A/**%0A *
@@ -478,32 +478,38 @@
 sports.Console(%7B
+%0A     
  prettyPrint: tr
@@ -503,32 +503,38 @@
 ettyPrint: true,
+%0A     
  colorize: true,
@@ -533,16 +533,22 @@
 e: true,
+%0A     
  level: 
@@ -555,17 +555,56 @@
 LOGG
-ING
+ER
 _LEVEL
+,%0A      timestamp: LOGGER_TIMESTAMP,%0A   
  %7D),

Prepend logs with date timestamp