Commit graph

231 commits

Author SHA1 Message Date
Michael Nisi
cf1926fef6 Ensure stream for type='stream' stream is a writable stream :)
Fixes #332
2016-02-28 22:35:56 -08:00
Martijn Schrage
d9c5970be2 Don't advance to next rotation time when timeout fires early
Fixes #344
2016-02-28 21:44:40 -08:00
Trent Mick
f36943bb2d bumpver for subsequent work 2016-02-21 17:18:54 -08:00
Trent Mick
cd7dc6a92c Improve the runtime environment detection to fix running under NW.js.
Contributions by Adam Lynch (#310), Jeremy Ruppel (#311),
and Aleksey Timchenko (#302).
2016-02-21 13:31:57 -08:00
Trent Mick
8b94e81fa7 'reemitErrorEvents' bool on Bunyan streams to control error event handling
Related to PR #318.
2016-02-20 18:04:47 -08:00
Trent Mick
6fdc5ff209 Style/changelog/readme/test case for "error" event re-emitting.
PR: #318
2016-02-10 23:38:23 -08:00
Marc Udoff
e0e06d3af5 Any stream with an on function will register for error 2016-02-10 23:29:48 -08:00
Trent Mick
904c29eebd prep for future dev 2016-02-10 22:36:32 -08:00
Trent Mick
6ff1f36abc momentjs: avoid for default fast path; make required only for local time
Make the default (long output format, UTC time) for the bunyan CLI a
fast path that doesn't use moment.js. Admittedly I haven't measured
percentage impact of `moment(rec.time).utc().format(...)` for
many bunyan records.

Also make moment dep *optional*. The bunyan CLI will error out without
the moment dep *only if local time is requested.*
2016-02-10 22:13:01 -08:00
Trent Mick
788ad7cefe fix LOG.child(...) to *not* override the "hostname" field of the parent
Fixes #291. Fixes #303.
2016-02-02 23:45:31 -08:00
Trent Mick
2a5e1fc715 Allow one to set level: 0 in createLogger to turn on logging for all levels.
Fixes #325.
2016-02-02 23:12:02 -08:00
Trent Mick
4619d33b57 prep for future dev 2015-09-07 14:45:14 -07:00
Trent Mick
86b6769087 Fix src: true, which was broken in v1.5.0.
Also add a test case for `src: true` which is how 1.5.0 got released
without noticing this.

Fixes #296.
2015-09-07 14:37:29 -07:00
Trent Mick
2975178220 prep for future dev 2015-09-07 01:27:17 -07:00
Trent Mick
27d60578a9 strict mode
Should fix usage with bundles including bunyan and using strict mode.
Had to fix a surprise effect that 'window === this' is no longer
true in strict mode:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
"""That means, among other things, that in browsers it's no longer
possible to reference the window object through this inside a strict
mode function."""

Fixes #236, #231, and #223.
2015-09-07 01:21:43 -07:00
Trent Mick
bf994a34b3 fix 'make check'; add some recent authors 2015-09-07 00:29:17 -07:00
Denis Izmaylov
466829dc73 Fix issues to work with webpack 2015-09-07 00:18:50 -07:00
Trent Mick
5e3e86cec3 bump to 1.5.0 2015-09-06 23:03:32 -07:00
Trent Mick
9d309c5dc4 comment tweak 2015-07-25 22:29:53 -07:00
Trent Mick
930ce61533 prep for future dev 2015-06-07 11:07:49 -07:00
Trent Mick
ff50cd3741 update versions to match 2015-06-07 11:07:31 -07:00
Trent Mick
15f2bb1133 prep for future dev 2015-06-01 22:13:17 -07:00
Trent Mick
a5bc7911d3 prep for future dev 2015-04-12 22:18:52 -07:00
Trent Mick
2828e462aa prep for future dev 2015-02-20 14:55:15 -08:00
Trent Mick
c25ce3a5bd Allow log.child(...) to work even if the logger is a *sub-class* of Bunyan's Logger class. 2015-02-20 14:52:37 -08:00
Trent Mick
a7c646191d Hide 'source-map-support' require from browserify. Fixes #219 2015-02-19 20:41:34 -08:00
Trent Mick
22669dbd32 Reset haveNonRawStreams on <logger>.addStream
Fixed #218
2015-02-05 21:45:55 -08:00
Trent Mick
6cabaa9a0b prep for future dev 2015-01-26 09:24:03 -08:00
Trent Mick
ffd9903d74 prep for future dev 2015-01-18 23:29:43 -08:00
Trent Mick
64b8fd1004 test cases for #182, style tweaks, changelog, etc. 2015-01-18 23:27:28 -08:00
Martin Gausby
c0ca774238 Defend against throwing defined props in stringify
If an object has a defined property, that is enumerable, and this
property throws an error, it will make JSON stringify throw an
error, and potentially bring down the program.

The solution so far is to try-catch with the usual json stringifyer,
that guards against circular references. If this throws an error
we will attempt to guard against defined properties; and return
[Throws] if a property throws an error when accesed.

The following examples illustrate the problem:

```js
var obj = {};
obj.__defineGetter__('foo', function() { throw new Error('ouch!'); });

JSON.stringify(obj.foo); // error thrown
```

And using `Object.defineProperty`:
```js
var obj = {};
Object.defineProperty(obj, 'foo', {
    get: function() { throw new Error('ouch!'); }
    enumerable: true // enumerable is false by default
});

JSON.stringify(obj.foo); // error thrown
```

The cases we have seen in production is third party modules that
has enumerable getters that try to access properties on undefined
objects.

Fixes #182.
2015-01-18 23:27:06 -08:00
Trent Mick
bed6fbfb66 prep for future dev 2015-01-17 22:05:16 -08:00
Trent Mick
08a4bab1ba fix 'make check' 2015-01-17 22:04:39 -08:00
Trent Mick
b9e3a0d3cb export 'bunyan.RotatingFileStream' 2015-01-17 21:56:46 -08:00
Trent Mick
83f33890de added integration with source-map-support for integration with sourcemaps
Style updates, changelog, etc. Fixes #122
2015-01-17 21:15:38 -08:00
Trent Mick
1ed684d110 Ensure a top-level level given in bunyan.createLogger is *used* for given streams
Fixes #164
2015-01-17 20:39:06 -08:00
Trent Mick
b975c3a9f8 prep for future dev 2015-01-17 13:34:33 -08:00
Trent Mick
838b1995ef correct version 2015-01-17 13:34:02 -08:00
Trent Mick
f4b97a4952 fix 'make check'; correct version 2015-01-17 13:33:12 -08:00
Trent Mick
da440c9324 Merge pull request #203 from cb1kenobi/useless_level
Removed useless level check.
2015-01-16 22:33:45 -08:00
Trent Mick
7dfde13ac3 Correct error added in commit d77f8247
Also, bump minor ver for `-L` CLI addition and coming release.
2015-01-16 22:31:50 -08:00
Trent Mick
d77f824723 improve rotating-file assert on 'count' field
Fixes #207, #208
2015-01-16 09:00:13 -08:00
Trent Mick
783b1c4e39 prep for future dev 2015-01-15 22:20:21 -08:00
Trent Mick
4009692cdb fix 'make check' 2015-01-15 22:19:59 -08:00
Trent Mick
7c0b566e63 [issue #210] Export bunyan.nameFromLevel and bunyan.levelFromName 2015-01-15 22:18:29 -08:00
Chris Barber
ee5d9b8082 Removed unless level check. 2014-12-28 21:37:21 -08:00
Trent Mick
2f95bb8091 Gracefully handle use of an unbound Logger.{info,debug,...} 2014-12-08 10:43:33 -08:00
Connor Peet
1e793b182c Don't make objCopy crash on non-objects 2014-12-05 22:23:43 -05:00
Trent Mick
79fc7178bd prep for future dev 2014-11-17 21:46:54 -08:00
Trent Mick
980e281096 #185 add some comments, const, Daniel to authors, and changelog 2014-11-17 21:45:41 -08:00