Skip to content

Releases: maraisr/diary

v0.4.0

10 Oct 10:59
ba130e0
Compare
Choose a tag to compare

BREAKING CHANGE

  • Loggers now support arbitrary log messages, see 78334b3

Log functions no longer require a message string in the first argument, this means
reporters that used to tap into extra for the spread arguments you will now
find this in the messages array.

- const reporter: Reporter = ({ name, level, message, extra, ...rest })
+ const reporter: Reporter = ({ name, level, messages, ...rest })
..
-   console.log({ message, extra });
+   const message = messages.shift();
+   console.log({ message, extra: messages });
  • Browsers no longer enable by default, see a4d95bc

In the past we enbaled anyting in the DEBUG localStorage key,
this lead to some undesired behaviours when working with sandboxed
iframes.

Now we will let the you control this completely, as from what I can see
the majority of folk I see, use it anyway.

Still makes sense to run this for Node applications, which is left un
touched.

If you want the existing behaviour, just attached this before you start
logging.

import { enable } from 'diary';
enable(localStorage.DEBUG || 'a^');

Full Changelog: v0.3.1...v0.4.0

v0.3.1

18 Jun 08:14
619a9d7
Compare
Choose a tag to compare

Features

  • loggers no longer crash due to nullish allowlist for workers targets by @cometkim in #19

Full Changelog: 0.3.0...v0.3.1

v0.3.0

04 Nov 00:35
f5f0997
Compare
Choose a tag to compare

Features

  • Workers api no longer appends a pretty symbol for the log level. (724fe38)

BREAKING CHANGES

  • In order to support Cloudflare Module Workers — ambient environment variables no longer exist. Which leaves this up to the developer to opt log events in with the supplied enable api. (61486c8)

Chores

  • A series of CI and repo health changes, bumped dev dependencies and updated benchmarks.

Full Changelog: 0.2.2...0.3.0

v0.2.2

21 Sep 12:10
70475fd
Compare
Choose a tag to compare

Bug fixes

  • After the last release (v0.2.0) type definition resolution broke in that instead of diary/index as the resolution path its diary/node/index which for obvious reasons doesn't have types. Now we just force the root to diary/index.d.ts70475fd

Features

  • Attempt a deno publish

v0.2.0

27 Aug 09:58
bb2d387
Compare
Choose a tag to compare

Features

diary now supports being used in a Cloudflare Worker — enabled via an Environment Variable named DEBUG to behave the same as though it was a node or browser runtime.

Build

diary is now built in 3 flavors and relies on bundles to import the correct one.

v0.1.6

01 Jun 07:44
ee0f1d1
Compare
Choose a tag to compare

Features

  • New compare util to help with log level comparing.
import { compare } from 'diary/utils';

// when `a` is _less-than_ `b` then -1
compare('warn', 'error');

// when `a` is _more-than_ `b` then 1
compare('fatal', 'error');

// when `a` is the _same_  as`b` then 0
compare('fatal', 'fatal');

v0.1.5

01 Jun 06:39
9c8f12a
Compare
Choose a tag to compare

Features

  • The default reporter is now exported as well import { defaultReporter } from 'diary';

v0.1.4

29 May 07:19
f820d69
Compare
Choose a tag to compare

Chores

  • Fixed broken typescript definitions resolution (#10) Thanks @maxmilton ~

v0.1.2

27 May 00:38
bb41c63
Compare
Choose a tag to compare

Breaking

  • Removed the setLevel method—all events will now log irrespective of their level.
    • this is a simple fix if you still need this, use the new onEmit callback to squash these.
  • Removed before/after. As it turns out, with the new onEmit api on diary. One can create the same effect—with much less overhead.

Features

  • Added new enable method to control the allow list programmatically.
  • Added new onEmit argument to the diary constructor. Allows you to output the log entries to other places, than console.log.
  • Following on from that; added a new diary/json sub-module that allows formatting the messages as json!

Chores

  • Upgraded packages
  • Builds using esbuild
  • Updated benchmarks