Browse Source

common-log-format dep no longer directly required

master
Lloyd Brookes 11 years ago
parent
commit
57672fd114
  1. 10
      bin/ws.js
  2. 1
      package.json

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();
statStream.pipe(logStats());
app.use(morgan({ stream: statStream }));
app.use(morgan({ stream: logStats() }));
} }
/* --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 {

1
package.json

@ -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",

Loading…
Cancel
Save