roarr

JSON logger for Node.js and browser.

OTHER License

Downloads
10.1M
Stars
1.1K
Committers
6

Bot releases are hidden (Show)

roarr - v7.14.0

Published by gajus about 2 years ago

7.14.0 (2022-10-18)

Features

roarr - v7.13.0

Published by gajus about 2 years ago

7.13.0 (2022-09-29)

Features

roarr - v7.12.3

Published by gajus about 2 years ago

7.12.3 (2022-08-22)

Bug Fixes

  • export MessageContext type (4247828)
roarr - v7.12.2

Published by gajus about 2 years ago

7.12.2 (2022-08-17)

Bug Fixes

roarr - v7.12.0

Published by gajus about 2 years ago

7.12.0 (2022-08-11)

Bug Fixes

  • correct json object type (a509215)

Features

  • add typescript guard for invalid printf usage (091d757)
roarr - v7.11.1

Published by gajus about 2 years ago

7.11.1 (2022-08-10)

Bug Fixes

  • throw error if user attempts to improperly invoke log() (a7376a9)
roarr - v7.11.0

Published by gajus over 2 years ago

7.11.0 (2022-03-24)

Features

  • add ROARR.serializeMessage (60a99cf)
roarr - v7.10.1

Published by gajus over 2 years ago

7.10.1 (2022-03-23)

Bug Fixes

  • provide fallback async local context (a5bd722)
roarr - v7.10.0

Published by gajus over 2 years ago

7.10.0 (2022-03-18)

Features

If you ever need to test what is getting logged, Roarr (v7.10) now has a neat trick:

const messages = [];

log.adopt(() => {
  yourApplication();
}, (message) => {
  messages.push(message);
});

messages now includes anything that is/will going to be logged by yourApplication (including any of the descending async contexts).

You could even do something like this:

log.adopt(() => {
  httpServer.listen(8080);
}, (message) => {
  messages.push(message);
})

Now messages would get appended to every time that HTTP server handles a request which produces Roarr logs.

Example of where this is useful:

https://github.com/gajus/fastify-webpack/commit/a71a8d864f1d39e304cbfca6bd1fc57ca6db5949#diff-0fedfd7c9fb1766a8baa39c2f5350d5697dc81cf10fc2065d457242c437104a2R146-R168

roarr - v7.9.0

Published by gajus over 2 years ago

7.9.0 (2022-03-15)

Features

  • handle invalid roarr invocation (fda6d7a)
roarr - v7.8.2

Published by gajus over 2 years ago

7.8.2 (2022-03-02)

Bug Fixes

  • avoid unnecessary stringify / parse (2df6c4c)
roarr - v7.8.1

Published by gajus over 2 years ago

7.8.1 (2022-02-19)

Bug Fixes

  • replace json-stringify-safe with fast-safe-stringify (ff8a1f7)
roarr - v7.8.0

Published by gajus almost 3 years ago

7.8.0 (2021-11-23)

Features

  • describe the unexpected type if message is not a string (e76d0ae)
roarr - v7.7.0

Published by gajus almost 3 years ago

7.7.0 (2021-11-13)

Features

  • allow to override context type (a43937d)
roarr - v7.6.1

Published by gajus almost 3 years ago

7.6.1 (2021-11-12)

Bug Fixes

  • loosen JsonObject definition to include undefined (e541931)
roarr - v7.6.0

Published by gajus almost 3 years ago

7.6.0 (2021-11-12)

Features

roarr - v7.5.0

Published by gajus almost 3 years ago

7.5.0 (2021-11-09)

Features

  • restrict allowed context values to serializable object (ece71aa)
roarr - v7.4.2

Published by gajus almost 3 years ago

7.4.2 (2021-11-09)

Bug Fixes

roarr - v7.4.1

Published by gajus almost 3 years ago

7.4.1 (2021-11-09)

Bug Fixes

  • restore accidentally deleted tests (04f014a)
roarr - v7.4.0

Published by gajus almost 3 years ago

7.4.0 (2021-11-06)

Features

  • simplify LogWriter interface (935c12a)
Package Rankings
Top 1.26% on Npmjs.org
Top 6.69% on Proxy.golang.org
Badges
Extracted from project README
NPM version Canonical Code Style Twitter Follow