added 'none' as a --log-format
This commit is contained in:
26
bin/ws.js
26
bin/ws.js
@ -16,7 +16,7 @@ var dope = require("console-dope"),
|
|||||||
|
|
||||||
var usage =
|
var usage =
|
||||||
"usage: \n\
|
"usage: \n\
|
||||||
$ ws [--directory|-d <dir>] [--port|-p <port>] [--log-format|-f dev|default|short|tiny|logstalgia] [--compress|-c]\n\
|
$ ws [--directory|-d <dir>] [--port|-p <port>] [--log-format|-f node|dev|default|short|tiny|logstalgia] [--compress|-c]\n\
|
||||||
$ ws --config\n\
|
$ ws --config\n\
|
||||||
$ ws --help|-h";
|
$ ws --help|-h";
|
||||||
|
|
||||||
@ -78,17 +78,21 @@ if (argv.config){
|
|||||||
|
|
||||||
/* log using --log-format (if supplied) */
|
/* log using --log-format (if supplied) */
|
||||||
if(argv["log-format"]) {
|
if(argv["log-format"]) {
|
||||||
if (argv["log-format"] === "logstalgia"){
|
if (argv["log-format"] === "none"){
|
||||||
/* customised logger :date token, purely to satisfy Logstalgia. */
|
// do nothing, no logging required
|
||||||
morgan.token("date", function(){
|
} else {
|
||||||
var a = new Date();
|
if (argv["log-format"] === "logstalgia"){
|
||||||
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
|
/* customised logger :date token, purely to satisfy Logstalgia. */
|
||||||
.replace("GMT", "").replace(" (BST)", "");
|
morgan.token("date", function(){
|
||||||
});
|
var a = new Date();
|
||||||
argv["log-format"] = "default";
|
return (a.getDate() + "/" + a.getUTCMonth() + "/" + a.getFullYear() + ":" + a.toTimeString())
|
||||||
}
|
.replace("GMT", "").replace(" (BST)", "");
|
||||||
|
});
|
||||||
|
argv["log-format"] = "default";
|
||||||
|
}
|
||||||
|
|
||||||
app.use(morgan(argv["log-format"]));
|
app.use(morgan(argv["log-format"]));
|
||||||
|
}
|
||||||
|
|
||||||
/* if no specific `--log-format` required, pipe the default web log output
|
/* if no specific `--log-format` required, pipe the default web log output
|
||||||
into `log-stats`, which prints statistics to the console */
|
into `log-stats`, which prints statistics to the console */
|
||||||
|
Reference in New Issue
Block a user