Skip to content

Commit

Permalink
🚧 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed May 21, 2024
1 parent 449fdfc commit 07a0b8a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as v4 from 'npm:diary@^0.4';
import * as v5 from './src/mod.ts';

let v4Events: any[] = [];
let v5Events: any[] = [];

{
v4.enable('*');
const log = v4.diary("v0.4", event => {
v4Events.push(event);
});

log.log("hello %s", "world", "extra", "props");
log.debug("hello %s", "world", "extra", "props");
log.info("hello %s", "world", "extra", "props");
log.warn("hello %s", "world", "extra", "props");
log.error("hello %s", "world", "extra", "props");
log.fatal("hello %s", "world", "extra", "props");
}

{
const log = v5.diary("v0.5", (...event: any[]) => {
v5Events.push(event);
});

log("log", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
log("debug", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
log("info", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
log("warn", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
log("error", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
log("fatal", "hello {phrase}", {phrase: "world", extra: ["extra", "props"]});
}

console.log({
v4Events,
v5Events
})

0 comments on commit 07a0b8a

Please sign in to comment.