debug-logfmt 1.2.1 → 1.2.2

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.
Files changed (2) hide show
  1. package/index.js +11 -12
  2. package/package.json +3 -3
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: n => format(Math.round(n))
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
- (...args) =>
35
- log(
36
- args.map(arg => (typeof arg === 'string' ? arg : encode(arg))).join(' ')
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
- (...opts) => {
51
- ;(type ? debug[type] : debug)(...args, ...opts, {
52
- duration: duration()
53
- })
54
- return true
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.1",
5
+ "version": "1.2.2",
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
- "@lukeed/ms": "~2.0.2",
33
- "debug-fabulous": "~2.0.2"
32
+ "debug-fabulous": "~2.0.2",
33
+ "pretty-ms": "~7.0.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/cli": "latest",