@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenna/logger",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "description": "The Athenna logging solution. Log in stdout, files and buckets.",
5
5
  "license": "MIT",
6
6
  "author": "João Lenon <lenon@athenna.io>",
@@ -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
- try {
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
  /**