Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Releases: mrbrianevans/timer-logs

v1.7.4

28 Sep 20:17
Compare
Choose a tag to compare

Notable changes in this release

  • multiline logging in development mode
  • set logging environment mode with LOGGING_ENV environment variable
  • better formatting of SQL and recognition of more keywords

Example of the new, multiline logs in development mode:
image

v1.6.0

23 Aug 19:10
Compare
Choose a tag to compare

New feature:
This release contains a new function on the Timer interface to log a SQL query in a specially formatted way.

timer.tsql`SELECT * FROM persons p join birthdays b ON p.date=b.date WHERE name='tom' AND b.age > 35 OR name=${name}`;

produces this log:
image

There is also a general logging method which makes use of tagged template literals:

const order = { code: "0001", qty: 81, items: [1, 2, 3] };
timer.tlog`New order received: ${order}`;

produces this log:

New order received: '{"code":"0001","qty":81,"items":[1,2,3]}'

v1.4.0

14 Aug 06:38
Compare
Choose a tag to compare

Added different presenters depending on the environment, so that logs are printed in a special way for development, production and in-browser.

v1.2.2

04 Aug 18:54
Compare
Choose a tag to compare

Changelog in this release:

  • an operationTime timer will be started by default when the class is instantiated, and logged when flush() is called. This is particularly helpful for the Google Cloud Logging summary line feature
  • a message will always be provided with log output
  • postgres errors will give a default message if the error does not contain one
  • all logs get a default message in the rare occurance that one slips though without a message