From b59314ccf4329379c1dccdee8e4fa3534756f4c6 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Wed, 11 Jun 2014 20:40:40 +0100 Subject: [PATCH] --logstalgia --- bin/ws.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/ws.js b/bin/ws.js index 803b806..d534694 100755 --- a/bin/ws.js +++ b/bin/ws.js @@ -27,13 +27,6 @@ function halt(message){ process.exit(1); } -/* customised logger :date token, purely to satisfy Logstalgia. */ -morgan.token("date", function(){ - var a = new Date(); - return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString()) - .replace("GMT", "").replace(" (BST)", ""); -}); - /* Merge together options from - ~/.local-web-server.json - {cwd}/.local-web-server.json @@ -53,6 +46,7 @@ try { { name: "help", alias: "h", type: Boolean }, { name: "directory", alias: "d", type: String, value: process.cwd() }, { name: "config", type: Boolean }, + { name: "logstalgia", type: Boolean }, { name: "compress", alias: "c", type: Boolean } ]).parse(); } catch(err){ @@ -60,6 +54,15 @@ try { } argv = o.extend(storedConfig, argv); +if (argv.logstalgia){ + /* customised logger :date token, purely to satisfy Logstalgia. */ + morgan.token("date", function(){ + var a = new Date(); + return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString()) + .replace("GMT", "").replace(" (BST)", ""); + }); +} + if (argv.config){ dope.log("Stored config: "); dope.log(storedConfig);