@athenna/logger 3.0.4 → 3.0.5
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/package.json +1 -1
- package/src/Formatters/Formatter.js +3 -10
package/package.json
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import rTracer from 'cls-rtracer'
|
|
11
|
+
|
|
10
12
|
import { hostname } from 'node:os'
|
|
11
13
|
import { Is } from '@athenna/common'
|
|
12
|
-
import { createRequire } from 'node:module'
|
|
13
14
|
import { ColorHelper } from '#src/Helpers/ColorHelper'
|
|
14
15
|
|
|
15
|
-
const require = createRequire(import.meta.url)
|
|
16
|
-
|
|
17
16
|
export class Formatter {
|
|
18
17
|
/**
|
|
19
18
|
* Holds the configuration object of formatter.
|
|
@@ -73,13 +72,7 @@ export class Formatter {
|
|
|
73
72
|
* @return {string | null}
|
|
74
73
|
*/
|
|
75
74
|
traceId() {
|
|
76
|
-
|
|
77
|
-
const rTracer = require('cls-rtracer')
|
|
78
|
-
|
|
79
|
-
return rTracer.id()
|
|
80
|
-
} catch (err) {
|
|
81
|
-
return null
|
|
82
|
-
}
|
|
75
|
+
return rTracer.id() || null
|
|
83
76
|
}
|
|
84
77
|
|
|
85
78
|
/**
|