-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,092 additions
and
1,954 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
*-lock.json | ||
*.lock | ||
*.log | ||
|
||
/coverage | ||
/.nyc_output | ||
|
||
# Editors | ||
*.iml | ||
/.idea | ||
/.vscode | ||
|
||
# Code | ||
/node.* | ||
/browser.* | ||
/json.* | ||
/utils.* | ||
node_modules | ||
/npm | ||
*.lcov | ||
/cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as v4 from 'npm:diary@^0.4'; | ||
import * as v5 from '../mod.ts'; | ||
|
||
v4.enable('*'); | ||
|
||
let log = v4.diary('test', (e) => { | ||
JSON.stringify(e); | ||
}); | ||
Deno.bench('v4', () => { | ||
log.info('hello', { name: 'world' }); | ||
}); | ||
|
||
let logv5 = v5.diary((e) => { | ||
JSON.stringify(e); | ||
}); | ||
Deno.bench('v5', () => { | ||
logv5('info', 'hello {name}', { name: 'world' }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Removed the `enable` function from the `diary` package. | ||
|
||
```diff | ||
- import { enable } from 'diary'; | ||
- enable('*'); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as v4 from 'npm:diary@^0.4'; | ||
import * as v5 from '../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((level, event, props) => { | ||
v5Events.push({ name: 'v0.5', level, messages: [event, props] }); | ||
}); | ||
|
||
log('debug', 'hello'); | ||
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} the time is {time}', { | ||
phrase: 'world', | ||
extra: ['extra', 'props'], | ||
time: 123, | ||
}); | ||
} | ||
|
||
console.log({ | ||
v4Events, | ||
v5Events, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.