debug-logfmt 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +11 -12
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -52,4 +52,4 @@ The log levels available.
|
|
|
52
52
|
**debug-logfmt** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/debug-logfmt/blob/master/LICENSE.md) License.<br>
|
|
53
53
|
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/debug-logfmt/contributors).
|
|
54
54
|
|
|
55
|
-
> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) ·
|
|
55
|
+
> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · X [@Kikobeats](https://x.com/Kikobeats)
|
package/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { encode } = require('@jclem/logfmt2')
|
|
4
|
-
const { format } = require('@lukeed/ms')
|
|
5
4
|
const origDebug = require('debug')
|
|
6
5
|
|
|
7
6
|
const timeSpan = require('@kikobeats/time-span')({
|
|
8
|
-
format:
|
|
7
|
+
format: require('pretty-ms')
|
|
9
8
|
})
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -31,10 +30,10 @@ const LEVELS = ['info', 'warn', 'error']
|
|
|
31
30
|
|
|
32
31
|
const createLogger =
|
|
33
32
|
log =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
(...args) =>
|
|
34
|
+
log(
|
|
35
|
+
args.map(arg => (typeof arg === 'string' ? arg : encode(arg))).join(' ')
|
|
36
|
+
)
|
|
38
37
|
|
|
39
38
|
module.exports = (env, { levels = LEVELS } = {}) => {
|
|
40
39
|
const debug = createLogger(createDebug(env))
|
|
@@ -47,12 +46,12 @@ module.exports = (env, { levels = LEVELS } = {}) => {
|
|
|
47
46
|
|
|
48
47
|
const create =
|
|
49
48
|
type =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
(...opts) => {
|
|
50
|
+
;(type ? debug[type] : debug)(...args, ...opts, {
|
|
51
|
+
duration: duration()
|
|
52
|
+
})
|
|
53
|
+
return true
|
|
54
|
+
}
|
|
56
55
|
|
|
57
56
|
const fn = create()
|
|
58
57
|
fn.error = create('error')
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "debug-logfmt",
|
|
3
3
|
"description": "debug module using logfmt format",
|
|
4
4
|
"homepage": "https://github.com/Kikobeats/debug-logfmt",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.3",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": {
|
|
8
8
|
"email": "josefrancisco.verdu@gmail.com",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@jclem/logfmt2": "~2.4.3",
|
|
31
31
|
"@kikobeats/time-span": "~1.0.2",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"debug-fabulous": "2.0.2",
|
|
33
|
+
"pretty-ms": "~7.0.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@commitlint/cli": "latest",
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"git-dirty": "latest",
|
|
46
46
|
"github-generate-release": "latest",
|
|
47
47
|
"nano-staged": "latest",
|
|
48
|
-
"npm-check-updates": "latest",
|
|
49
48
|
"nyc": "latest",
|
|
50
49
|
"simple-git-hooks": "latest",
|
|
51
50
|
"standard": "latest",
|
|
@@ -62,7 +61,12 @@
|
|
|
62
61
|
"commitlint": {
|
|
63
62
|
"extends": [
|
|
64
63
|
"@commitlint/config-conventional"
|
|
65
|
-
]
|
|
64
|
+
],
|
|
65
|
+
"rules": {
|
|
66
|
+
"body-max-line-length": [
|
|
67
|
+
0
|
|
68
|
+
]
|
|
69
|
+
}
|
|
66
70
|
},
|
|
67
71
|
"nano-staged": {
|
|
68
72
|
"*.js": [
|
|
@@ -87,14 +91,12 @@
|
|
|
87
91
|
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
|
88
92
|
"lint": "standard-markdown README.md && standard",
|
|
89
93
|
"postrelease": "npm run release:tags && npm run release:github && ci-publish",
|
|
90
|
-
"prerelease": "npm run update:check",
|
|
91
94
|
"pretest": "npm run lint",
|
|
92
95
|
"pretty": "prettier-standard index.js {core,test,bin,scripts}/**/*.js --single-quote --print-width 100",
|
|
93
96
|
"release": "git-authors-cli && git add package.json && standard-version -a",
|
|
94
97
|
"release:github": "github-generate-release",
|
|
95
98
|
"release:tags": "git push --follow-tags origin HEAD:master",
|
|
96
99
|
"test": "exit 0",
|
|
97
|
-
"update": "ncu -a"
|
|
98
|
-
"update:check": "ncu -- --error-level 2"
|
|
100
|
+
"update": "ncu -a"
|
|
99
101
|
}
|
|
100
102
|
}
|