common-log-format dep no longer directly required
This commit is contained in:
10
bin/ws.js
10
bin/ws.js
@ -14,7 +14,6 @@ var dope = require("console-dope"),
|
|||||||
compress = require("compression"),
|
compress = require("compression"),
|
||||||
homePath = require("home-path"),
|
homePath = require("home-path"),
|
||||||
byteSize = require("byte-size"),
|
byteSize = require("byte-size"),
|
||||||
clf = require("common-log-format"),
|
|
||||||
logStats = require("stream-log-stats");
|
logStats = require("stream-log-stats");
|
||||||
|
|
||||||
var usage =
|
var usage =
|
||||||
@ -91,10 +90,11 @@ if (argv.config){
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.use(morgan(argv["log-format"]));
|
app.use(morgan(argv["log-format"]));
|
||||||
|
|
||||||
|
/* if no specific `--log-format` required, pipe the default web log output
|
||||||
|
into `log-stats`, which prints statistics to the console */
|
||||||
} else {
|
} else {
|
||||||
var statStream = clf();
|
app.use(morgan({ stream: logStats() }));
|
||||||
statStream.pipe(logStats());
|
|
||||||
app.use(morgan({ stream: statStream }));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --compress enables compression */
|
/* --compress enables compression */
|
||||||
@ -115,7 +115,7 @@ if (argv.config){
|
|||||||
})
|
})
|
||||||
.listen(argv.port);
|
.listen(argv.port);
|
||||||
|
|
||||||
/* write status to stderr so stdout can be piped to disk ($ ws > log.txt) */
|
/* write status to stderr (stdout is reserved for web log output) */
|
||||||
if (path.resolve(argv.directory) === process.cwd()){
|
if (path.resolve(argv.directory) === process.cwd()){
|
||||||
dope.error("serving at %underline{%s}", "http://localhost:" + argv.port);
|
dope.error("serving at %underline{%s}", "http://localhost:" + argv.port);
|
||||||
} else {
|
} else {
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"byte-size": "^0.1.0",
|
"byte-size": "^0.1.0",
|
||||||
"command-line-args": "^0.2.0",
|
"command-line-args": "^0.2.0",
|
||||||
"common-log-format": "^0.1.2",
|
|
||||||
"compression": "^1.0.2",
|
"compression": "^1.0.2",
|
||||||
"config-master": "~0.2.0",
|
"config-master": "~0.2.0",
|
||||||
"connect": "^3.0.0",
|
"connect": "^3.0.0",
|
||||||
|
Reference in New Issue
Block a user