Skip to content

Releases: telefonicaid/logops

2.1.2

10 Jan 17:41
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.1.1...2.1.2

Release 2.1.0

11 Jul 08:53
6023d75
Compare
Choose a tag to compare

Feature: Child Loggers

You can create an specialized logger for a part of your app with bound static context/properties. The child logger will inherit its parent config: level, format, stream and context. If the parent logger has a context returned by parent.getContext(), the conflicting child logger context will take precedence

let child = logger.child({component: 'client'});
child.info('Startup');
// {"component":"client","time":"2015-12-23T11:47:25.862Z","lvl":"INFO","msg":"Startup"}

https://github.com/telefonicaid/logops#child-loggers

Performance improvements

2.0.0

03 May 21:22
0206cd4
Compare
Choose a tag to compare

Sets the node environment for this version to be node>6
Feature:

  • Make node 6 compatible (#39)

BREAKING CHANGES:

  • Dates are formatted always as ISOString when used as parameter without placeholders
 logger.info('Today is', new Date());
// Before: "msg": "Today is Thu Jan 01 1970 01:00:00 GMT+0100 (CET)"
// Now:    "msg": "Today is 1970-01-01T00:00:00.000Z"
  • Errors will incorporate stack traces instead of the node4 bracket notation when used as parameter without placeholders
logger.info('Oh oh!', new Error('boom')) 
// Before: "msg": "Oh oh! [Error: boom]"
// Now:    "msg": "Oh oh! Error: boom\n    at repl:1:23\n    at sigintHandlersWrap (vm.js:22:35)\n    at sigintHandlersWrap (vm.js:96:12)\n    at ContextifyScript.Script.runInThisContext (vm.js:21:12)\n    at REPLServer.defaultEval (repl.js:340:29)\n    at bound (domain.js:280:14)\n    at REPLServer.runBound [as eval] (domain.js:293:12)\n    at REPLServer.<anonymous> (repl.js:538:10)\n    at emitOne (events.js:101:20)\n    at REPLServer.emit (events.js:188:7)"

When used with placeholders the behavior is consistent across versions

// Both in 1.x and 2.x, the output is the same
logger.info('Today is %s', new Date())
// "msg":"Today is Thu Jan 01 1970 01:00:00 GMT+0100 (CET)"
logger.info('Oh oh! %s', new Error('boom'))
// "msg":"Oh oh! Error: boom"

Inherited breaking changes explanation
Node6 incorporated these breaking changes that we inherit because we delegate in utils.format (ref https://github.com/nodejs/node/wiki/Breaking-changes-between-v5-and-v6#util)

##### node 6
> console.log('Today is', new Date())
Today is 2017-05-04T07:37:31.343Z
> console.log('Today is %s', new Date())
Today is Thu May 04 2017 09:37:37 GMT+0200 (CEST)
> console.log('Oh oh!', new Error('boom')) 
Oh oh! Error: boom
    at repl:1:23
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:538:10)
    at emitOne (events.js:101:20)
    at REPLServer.emit (events.js:188:7)
> console.log('Oh oh! %s', new Error('boom')) 
Oh oh! Error: boom


##### node 4
> console.log('Today is', new Date())
Today is Thu May 04 2017 09:40:22 GMT+0200 (CEST)
> console.log('Today is %s', new Date())
Today is Thu May 04 2017 09:40:25 GMT+0200 (CEST)
> console.log('Oh oh!', new Error('boom')) 
Oh oh! [Error: boom]
> console.log('Oh oh! %s', new Error('boom')) 
Oh oh! Error: boom

1.0.8

03 May 21:08
Compare
Choose a tag to compare

This release only sets the package.json engine to be node <6, to encourage users using >6 to update to v2.0.0 cause of node ultil.format breaking changes that we inherit

Features:

  • Bump version 1.0.8 to be node < 6 compatible #38

Release 1.0.7

04 Oct 15:33
7737d80
Compare
Choose a tag to compare
Release 1.0.7

Release 1.0.6

30 Aug 13:31
bb54f57
Compare
Choose a tag to compare
Release 1.0.6

Release 1.0.5

23 Aug 15:44
0b06fd2
Compare
Choose a tag to compare
Release 1.0.5

Release 1.0.4

23 Aug 14:17
bfe9641
Compare
Choose a tag to compare
Release 1.0.4

Release 1.0.3

23 Aug 13:37
8e9537a
Compare
Choose a tag to compare
Release 1.0.3

Release 1.0.2

23 Aug 10:51
8432374
Compare
Choose a tag to compare
Release 1.0.2