Skip to content

Commit

Permalink
Deprecate buffer option
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Nov 7, 2014
1 parent d6341cb commit e4730cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ unreleased
- `clf` for the common log format
- `iso` for the common ISO 8601 date time format
- `web` for the common RFC 1123 date time format
* Deprecate `buffer` option
* Fix date format in `common` and `combined` formats
* Fix token arguments to accept values with `"`

Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ a string of a format string, or a function that will produce a log entry.

Morgan accepts these properties in the options object.

#### buffer

Buffer duration before writing logs to the `stream`, defaults to `false`. When
set to `true`, defaults to `1000 ms`.

#### immediate

Write log line on request instead of response. This means that a requests will
Expand Down Expand Up @@ -103,15 +98,11 @@ The minimal output.

- `:req[header]` ex: `:req[Accept]`
- `:res[header]` ex: `:res[Content-Length]`
- `:http-version`
- `:response-time`
- `:remote-addr`
- `:remote-user`
- `:date[format]`
- `:method`
- `:url`
- `:referrer`
- `:user-agent`
- `:status`

##### Creating new tokens
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ exports = module.exports = function morgan(format, options) {
// format function
var fmt = compile(exports[format] || format || exports.default)

// options
// steam
var buffer = options.buffer
var stream = options.stream || process.stdout
, buffer = options.buffer;

// buffering support
if (buffer) {
deprecate('buffer option')

var realStream = stream
var buf = []
var timer = null
Expand Down

0 comments on commit e4730cf

Please sign in to comment.