@vvlad1973/simple-logger 2.1.7 → 2.1.9

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 (60) hide show
  1. package/.markdownlint.json +9 -0
  2. package/CHANGELOG.md +173 -173
  3. package/dist/__test__/simple-logger.test.js +65 -65
  4. package/dist/classes/simple-logger.d.ts +125 -125
  5. package/dist/classes/simple-logger.js +294 -289
  6. package/dist/classes/simple-logger.js.map +1 -1
  7. package/dist/constants/constants.d.ts +9 -9
  8. package/dist/constants/constants.js +9 -9
  9. package/dist/helpers/helpers.d.ts +31 -31
  10. package/dist/helpers/helpers.js +80 -80
  11. package/dist/helpers/validators.d.ts +17 -17
  12. package/dist/helpers/validators.js +26 -26
  13. package/dist/index.d.ts +5 -5
  14. package/dist/index.js +5 -5
  15. package/dist/simple-logger.d.ts +80 -80
  16. package/dist/simple-logger.js +151 -151
  17. package/dist/types/simple-logger.types.d.ts +33 -33
  18. package/dist/types/simple-logger.types.js +1 -1
  19. package/docs/typedoc/assets/main.js +60 -0
  20. package/docs/typedoc/assets/search.js +1 -0
  21. package/docs/{assets → typedoc/assets}/style.css +248 -226
  22. package/docs/typedoc/classes/SimpleLogger.html +37 -0
  23. package/docs/typedoc/hierarchy.html +1 -0
  24. package/docs/typedoc/index.html +68 -0
  25. package/docs/typedoc/interfaces/ExternalLogger.html +10 -0
  26. package/docs/typedoc/interfaces/LogFn.html +1 -0
  27. package/docs/typedoc/interfaces/LoggerOptions.html +6 -0
  28. package/docs/typedoc/modules.html +1 -0
  29. package/docs/typedoc/types/LoggerFactory.html +1 -0
  30. package/docs/typedoc/types/LoggerLevel.html +1 -0
  31. package/docs/typedoc/types/PreparedLogCall.html +1 -0
  32. package/docs/typedoc/variables/LoggerLevels.html +1 -0
  33. package/eslint.config.js +63 -0
  34. package/package.json +27 -10
  35. package/src/__test__/simple-logger.test.ts +1 -1
  36. package/src/classes/simple-logger.ts +27 -16
  37. package/src/helpers/helpers.ts +1 -1
  38. package/src/helpers/validators.ts +1 -1
  39. package/src/index.ts +1 -1
  40. package/src/types/simple-logger.types.ts +2 -2
  41. package/typedoc.json +1 -1
  42. package/vitest.config.ts +35 -0
  43. package/docs/assets/main.js +0 -60
  44. package/docs/assets/search.js +0 -1
  45. package/docs/classes/SimpleLogger.html +0 -37
  46. package/docs/index.html +0 -68
  47. package/docs/interfaces/ExternalLogger.html +0 -10
  48. package/docs/interfaces/LogFn.html +0 -1
  49. package/docs/interfaces/LoggerOptions.html +0 -5
  50. package/docs/modules.html +0 -1
  51. package/docs/types/LoggerFactory.html +0 -1
  52. package/docs/types/LoggerLevel.html +0 -1
  53. package/docs/types/PreparedLogCall.html +0 -1
  54. package/docs/variables/LoggerLevels.html +0 -1
  55. /package/docs/{.nojekyll → typedoc/.nojekyll} +0 -0
  56. /package/docs/{assets → typedoc/assets}/hierarchy.js +0 -0
  57. /package/docs/{assets → typedoc/assets}/highlight.css +0 -0
  58. /package/docs/{assets → typedoc/assets}/icons.js +0 -0
  59. /package/docs/{assets → typedoc/assets}/icons.svg +0 -0
  60. /package/docs/{assets → typedoc/assets}/navigation.js +0 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "default": true,
3
+ "MD013": false,
4
+ "MD033": false,
5
+ "MD041": false,
6
+ "MD024": {
7
+ "siblings_only": true
8
+ }
9
+ }
package/CHANGELOG.md CHANGED
@@ -1,173 +1,173 @@
1
- # Changelog
2
-
3
- ## [2.1.5](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.4...v2.1.5)
4
-
5
- ### Fixes
6
-
7
- - **fix**: Types exports has been fixed (2025-05-05) [`dfac5087c9a7f5c8e38ea91c2f1e413e9ca1e063`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/dfac5087c9a7f5c8e38ea91c2f1e413e9ca1e063)
8
-
9
- ## [2.1.4](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.3...v2.1.4)
10
-
11
- ### Fixes
12
-
13
- - **fix**: Imports has been fixed (2025-05-05) [`146832a2afae4ad5e10405bb0ca1d518b33a48b0`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/146832a2afae4ad5e10405bb0ca1d518b33a48b0)
14
-
15
- ## [2.1.3](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.2...v2.1.3)
16
-
17
- ### Fixes
18
-
19
- - **fix**: Exports has been fixed (2025-05-04) [`bc632807ff7e43fe1bc0f8e417dee71f658988be`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/bc632807ff7e43fe1bc0f8e417dee71f658988be)
20
-
21
- ## [2.1.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.2...v2.1.0)
22
-
23
- ### Features
24
-
25
- - **feat**(LoggerOptions interface): LoggerOptions interface has been improved (2025-05-04) [`4b3e8df640947af243058ca6a75939708dfba015`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/4b3e8df640947af243058ca6a75939708dfba015)
26
-
27
- ## [2.0.2](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.1...v2.0.2)
28
-
29
- ### Fixes
30
-
31
- - **fix**: Fixed exports of types (2025-05-04) [`b30a2a592dd11af6df352403f48e8b63144ef4af`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/b30a2a592dd11af6df352403f48e8b63144ef4af)
32
-
33
- ## [2.0.1](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.0...v2.0.1)
34
-
35
- ### Documentation
36
-
37
- - **docs**: Documentation has been updated (2025-05-04) [`b902f966507fe2e114ba4021e67ce011b24566fb`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/b902f966507fe2e114ba4021e67ce011b24566fb)
38
-
39
- ## [2.0.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.2...v2.0.0)
40
-
41
- ### ⚠️ Breaking Changes
42
-
43
- - **feat**: Added .child() method, support creating child instances of logger with different bindings and message prefixes (2025-05-04) [`2f9591c48007bc29e441c32fc1480353a691ec47`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f9591c48007bc29e441c32fc1480353a691ec47)
44
-
45
- Changed signature of constructor of the class
46
-
47
- ### Documentation
48
-
49
- - **docs**: Documentation has been updated (2025-05-04) [`7599a27dc0a31f1418ee920cb8d341f16c062334`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7599a27dc0a31f1418ee920cb8d341f16c062334)
50
-
51
- Changed signature of constructor of the class
52
-
53
- ## [1.2.2](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.1...v1.2.2)
54
-
55
- ### Documentation
56
-
57
- - **docs**: Docs updated (2025-03-03) [`ec39cdecd7e2c8b7b070e301c89ed492779f235c`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/ec39cdecd7e2c8b7b070e301c89ed492779f235c)
58
-
59
- ## [1.2.1](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.0...v1.2.1)
60
-
61
- ### Documentation
62
-
63
- - **docs**: Moved to TypeDoc, generated docs (2025-03-03) [`ca09fad9642b2a2327f133cb360432d87ae588a9`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/ca09fad9642b2a2327f133cb360432d87ae588a9)
64
-
65
- ## [1.2.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.29...v1.2.0)
66
-
67
- ### Features
68
-
69
- - **feat**(SimpleLogger): Added property isExternal (2024-08-06) [`06432b0bd0454f0297bbbb6886e9174d3cdfc7ab`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/06432b0bd0454f0297bbbb6886e9174d3cdfc7ab)
70
-
71
- ## [1.1.29](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.28...v1.1.29)
72
-
73
- ### Fixes
74
-
75
- - **fix**(setExternalLogger()): Fixed bug with initialize log level (2024-07-28) [`4e678c4479e84ec11ffd34d505ff2e16c8d4b72e`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/4e678c4479e84ec11ffd34d505ff2e16c8d4b72e)
76
-
77
- ## [1.1.27](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.26...v1.1.27)
78
-
79
- ### Features
80
-
81
- - **feat**: Add export LoggerLevel type (2024-07-28) [`51f2f44f1b7979ad3539e72b06d2c3ce76e94c6d`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/51f2f44f1b7979ad3539e72b06d2c3ce76e94c6d)
82
-
83
- ## [1.1.25](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.24...v1.1.25)
84
-
85
- ### Fixes
86
-
87
- - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`2f0a7979fe30098bf2a211ead265fa09d770b4cf`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f0a7979fe30098bf2a211ead265fa09d770b4cf)
88
-
89
- ## [1.1.24](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.23...v1.1.24)
90
-
91
- ### Fixes
92
-
93
- - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`85a8e9de3dd15fe18ede74c2654f39d9256095c5`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/85a8e9de3dd15fe18ede74c2654f39d9256095c5)
94
-
95
- ## [1.1.23](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.22...v1.1.23)
96
-
97
- ### Fixes
98
-
99
- - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`cd9649314135f2e5f403a01372f19c13c6c94057`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/cd9649314135f2e5f403a01372f19c13c6c94057)
100
-
101
- ## [1.1.21](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.20...v1.1.21)
102
-
103
- ### Fixes
104
-
105
- - **fix**(simple-logger.ys): Fixed bug in .setLevel() (2024-07-19) [`26a26901491fede98508d195612dacf6ab8dc694`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/26a26901491fede98508d195612dacf6ab8dc694)
106
-
107
- ## [1.1.20](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.19...v1.1.20)
108
-
109
- ### Fixes
110
-
111
- - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`f50f4530b61e230a93d6e55a1c573ddbf8bd549e`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/f50f4530b61e230a93d6e55a1c573ddbf8bd549e)
112
-
113
- ## [1.1.19](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.18...v1.1.19)
114
-
115
- ### Fixes
116
-
117
- - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`7e9f06b6b91f800727f1dd13e38cbb5ea578775a`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7e9f06b6b91f800727f1dd13e38cbb5ea578775a)
118
-
119
- ## [1.1.18](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.17...v1.1.18)
120
-
121
- ### Fixes
122
-
123
- - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`9027c4231b36998d32afd1b03c81a32828b2c91a`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/9027c4231b36998d32afd1b03c81a32828b2c91a)
124
-
125
- ## [1.1.16](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.15...v1.1.16)
126
-
127
- ### Fixes
128
-
129
- - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`3af08379e662e9df7fbe89bf0b85d482efa83bf3`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/3af08379e662e9df7fbe89bf0b85d482efa83bf3)
130
-
131
- ## [1.1.14](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.13...v1.1.14)
132
-
133
- ### Fixes
134
-
135
- - **fix**(simple-logger.ts): Fixed bug with set log lever for external logger (2024-07-18) [`a3a945b4220997611b706dd1ca7ef33bfbc2efd7`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/a3a945b4220997611b706dd1ca7ef33bfbc2efd7)
136
-
137
- ## [1.1.13](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.12...v1.1.13)
138
-
139
- ### Fixes
140
-
141
- - **fix**(simple-logger.ts): Fixed bug with set log lever for external logger (2024-07-18) [`2f181e8d5ed4590411242896f7eda0709f4039df`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f181e8d5ed4590411242896f7eda0709f4039df)
142
-
143
- ## [1.1.11](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.10...v1.1.11)
144
-
145
- ### Fixes
146
-
147
- - **fix**(simple-logger.ts): Delete debug console output messages (2024-07-05) [`fe98428c8393166e52c0bd9a60aeefb6a88d4f2c`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/fe98428c8393166e52c0bd9a60aeefb6a88d4f2c)
148
-
149
- ## [1.1.10](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.9...v1.1.10)
150
-
151
- ### Fixes
152
-
153
- - **fix**(.getExternalLoggerMethod()): Minor fix debug info (2024-07-05) [`e81c536a567453e8404d3bb2e24a68e1f6c5ea2d`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/e81c536a567453e8404d3bb2e24a68e1f6c5ea2d)
154
-
155
- ## [1.1.9](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.8...v1.1.9)
156
-
157
- ### Fixes
158
-
159
- - **fix**(.getExternalLoggerMethod()): Fixed console out (2024-07-05) [`d67ba19d547265bb78f3d8ad7dbc39a1ffdfe8ad`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/d67ba19d547265bb78f3d8ad7dbc39a1ffdfe8ad)
160
-
161
- ## [1.1.8](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.7...v1.1.8)
162
-
163
- ### Features
164
-
165
- - **feat**(SimpleLogger): Added possibility to set fallback logging method in internal method .getExternalLoggerMethod# (2024-07-05) [`1b5d6dd74ace8a2daba95f0536ebbc6a3f18f7a7`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/1b5d6dd74ace8a2daba95f0536ebbc6a3f18f7a7)
166
-
167
- Added private notation to #
168
-
169
- ## [1.1.6](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.5...v1.1.6)
170
-
171
- ### Fixes
172
-
173
- - **fix**(index.ts): Fixed exports (2024-07-05) [`7441a0a0c7ffd0cfa802c43060996221060bab03`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7441a0a0c7ffd0cfa802c43060996221060bab03)
1
+ # Changelog
2
+
3
+ ## [2.1.5](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.4...v2.1.5)
4
+
5
+ ### Fixes
6
+
7
+ - **fix**: Types exports has been fixed (2025-05-05) [`dfac5087c9a7f5c8e38ea91c2f1e413e9ca1e063`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/dfac5087c9a7f5c8e38ea91c2f1e413e9ca1e063)
8
+
9
+ ## [2.1.4](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.3...v2.1.4)
10
+
11
+ ### Fixes
12
+
13
+ - **fix**: Imports has been fixed (2025-05-05) [`146832a2afae4ad5e10405bb0ca1d518b33a48b0`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/146832a2afae4ad5e10405bb0ca1d518b33a48b0)
14
+
15
+ ## [2.1.3](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.1.2...v2.1.3)
16
+
17
+ ### Fixes
18
+
19
+ - **fix**: Exports has been fixed (2025-05-04) [`bc632807ff7e43fe1bc0f8e417dee71f658988be`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/bc632807ff7e43fe1bc0f8e417dee71f658988be)
20
+
21
+ ## [2.1.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.2...v2.1.0)
22
+
23
+ ### Features
24
+
25
+ - **feat**(LoggerOptions interface): LoggerOptions interface has been improved (2025-05-04) [`4b3e8df640947af243058ca6a75939708dfba015`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/4b3e8df640947af243058ca6a75939708dfba015)
26
+
27
+ ## [2.0.2](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.1...v2.0.2)
28
+
29
+ ### Fixes
30
+
31
+ - **fix**: Fixed exports of types (2025-05-04) [`b30a2a592dd11af6df352403f48e8b63144ef4af`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/b30a2a592dd11af6df352403f48e8b63144ef4af)
32
+
33
+ ## [2.0.1](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v2.0.0...v2.0.1)
34
+
35
+ ### Documentation
36
+
37
+ - **docs**: Documentation has been updated (2025-05-04) [`b902f966507fe2e114ba4021e67ce011b24566fb`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/b902f966507fe2e114ba4021e67ce011b24566fb)
38
+
39
+ ## [2.0.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.2...v2.0.0)
40
+
41
+ ### ⚠️ Breaking Changes
42
+
43
+ - **feat**: Added .child() method, support creating child instances of logger with different bindings and message prefixes (2025-05-04) [`2f9591c48007bc29e441c32fc1480353a691ec47`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f9591c48007bc29e441c32fc1480353a691ec47)
44
+
45
+ Changed signature of constructor of the class
46
+
47
+ ### Documentation
48
+
49
+ - **docs**: Documentation has been updated (2025-05-04) [`7599a27dc0a31f1418ee920cb8d341f16c062334`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7599a27dc0a31f1418ee920cb8d341f16c062334)
50
+
51
+ Changed signature of constructor of the class
52
+
53
+ ## [1.2.2](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.1...v1.2.2)
54
+
55
+ ### Documentation
56
+
57
+ - **docs**: Docs updated (2025-03-03) [`ec39cdecd7e2c8b7b070e301c89ed492779f235c`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/ec39cdecd7e2c8b7b070e301c89ed492779f235c)
58
+
59
+ ## [1.2.1](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.2.0...v1.2.1)
60
+
61
+ ### Documentation
62
+
63
+ - **docs**: Moved to TypeDoc, generated docs (2025-03-03) [`ca09fad9642b2a2327f133cb360432d87ae588a9`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/ca09fad9642b2a2327f133cb360432d87ae588a9)
64
+
65
+ ## [1.2.0](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.29...v1.2.0)
66
+
67
+ ### Features
68
+
69
+ - **feat**(SimpleLogger): Added property isExternal (2024-08-06) [`06432b0bd0454f0297bbbb6886e9174d3cdfc7ab`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/06432b0bd0454f0297bbbb6886e9174d3cdfc7ab)
70
+
71
+ ## [1.1.29](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.28...v1.1.29)
72
+
73
+ ### Fixes
74
+
75
+ - **fix**(setExternalLogger()): Fixed bug with initialize log level (2024-07-28) [`4e678c4479e84ec11ffd34d505ff2e16c8d4b72e`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/4e678c4479e84ec11ffd34d505ff2e16c8d4b72e)
76
+
77
+ ## [1.1.27](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.26...v1.1.27)
78
+
79
+ ### Features
80
+
81
+ - **feat**: Add export LoggerLevel type (2024-07-28) [`51f2f44f1b7979ad3539e72b06d2c3ce76e94c6d`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/51f2f44f1b7979ad3539e72b06d2c3ce76e94c6d)
82
+
83
+ ## [1.1.25](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.24...v1.1.25)
84
+
85
+ ### Fixes
86
+
87
+ - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`2f0a7979fe30098bf2a211ead265fa09d770b4cf`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f0a7979fe30098bf2a211ead265fa09d770b4cf)
88
+
89
+ ## [1.1.24](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.23...v1.1.24)
90
+
91
+ ### Fixes
92
+
93
+ - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`85a8e9de3dd15fe18ede74c2654f39d9256095c5`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/85a8e9de3dd15fe18ede74c2654f39d9256095c5)
94
+
95
+ ## [1.1.23](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.22...v1.1.23)
96
+
97
+ ### Fixes
98
+
99
+ - **fix**(constructor): Changed initialization of level logging when the object creating (2024-07-28) [`cd9649314135f2e5f403a01372f19c13c6c94057`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/cd9649314135f2e5f403a01372f19c13c6c94057)
100
+
101
+ ## [1.1.21](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.20...v1.1.21)
102
+
103
+ ### Fixes
104
+
105
+ - **fix**(simple-logger.ys): Fixed bug in .setLevel() (2024-07-19) [`26a26901491fede98508d195612dacf6ab8dc694`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/26a26901491fede98508d195612dacf6ab8dc694)
106
+
107
+ ## [1.1.20](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.19...v1.1.20)
108
+
109
+ ### Fixes
110
+
111
+ - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`f50f4530b61e230a93d6e55a1c573ddbf8bd549e`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/f50f4530b61e230a93d6e55a1c573ddbf8bd549e)
112
+
113
+ ## [1.1.19](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.18...v1.1.19)
114
+
115
+ ### Fixes
116
+
117
+ - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`7e9f06b6b91f800727f1dd13e38cbb5ea578775a`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7e9f06b6b91f800727f1dd13e38cbb5ea578775a)
118
+
119
+ ## [1.1.18](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.17...v1.1.18)
120
+
121
+ ### Fixes
122
+
123
+ - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`9027c4231b36998d32afd1b03c81a32828b2c91a`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/9027c4231b36998d32afd1b03c81a32828b2c91a)
124
+
125
+ ## [1.1.16](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.15...v1.1.16)
126
+
127
+ ### Fixes
128
+
129
+ - **fix**(simple-logger.ts): Fixed settings log level (2024-07-19) [`3af08379e662e9df7fbe89bf0b85d482efa83bf3`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/3af08379e662e9df7fbe89bf0b85d482efa83bf3)
130
+
131
+ ## [1.1.14](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.13...v1.1.14)
132
+
133
+ ### Fixes
134
+
135
+ - **fix**(simple-logger.ts): Fixed bug with set log lever for external logger (2024-07-18) [`a3a945b4220997611b706dd1ca7ef33bfbc2efd7`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/a3a945b4220997611b706dd1ca7ef33bfbc2efd7)
136
+
137
+ ## [1.1.13](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.12...v1.1.13)
138
+
139
+ ### Fixes
140
+
141
+ - **fix**(simple-logger.ts): Fixed bug with set log lever for external logger (2024-07-18) [`2f181e8d5ed4590411242896f7eda0709f4039df`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/2f181e8d5ed4590411242896f7eda0709f4039df)
142
+
143
+ ## [1.1.11](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.10...v1.1.11)
144
+
145
+ ### Fixes
146
+
147
+ - **fix**(simple-logger.ts): Delete debug console output messages (2024-07-05) [`fe98428c8393166e52c0bd9a60aeefb6a88d4f2c`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/fe98428c8393166e52c0bd9a60aeefb6a88d4f2c)
148
+
149
+ ## [1.1.10](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.9...v1.1.10)
150
+
151
+ ### Fixes
152
+
153
+ - **fix**(.getExternalLoggerMethod()): Minor fix debug info (2024-07-05) [`e81c536a567453e8404d3bb2e24a68e1f6c5ea2d`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/e81c536a567453e8404d3bb2e24a68e1f6c5ea2d)
154
+
155
+ ## [1.1.9](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.8...v1.1.9)
156
+
157
+ ### Fixes
158
+
159
+ - **fix**(.getExternalLoggerMethod()): Fixed console out (2024-07-05) [`d67ba19d547265bb78f3d8ad7dbc39a1ffdfe8ad`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/d67ba19d547265bb78f3d8ad7dbc39a1ffdfe8ad)
160
+
161
+ ## [1.1.8](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.7...v1.1.8)
162
+
163
+ ### Features
164
+
165
+ - **feat**(SimpleLogger): Added possibility to set fallback logging method in internal method .getExternalLoggerMethod# (2024-07-05) [`1b5d6dd74ace8a2daba95f0536ebbc6a3f18f7a7`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/1b5d6dd74ace8a2daba95f0536ebbc6a3f18f7a7)
166
+
167
+ Added private notation to #
168
+
169
+ ## [1.1.6](https://github.com/vvlad1973/vvlad1973-simple-logger/compare/v1.1.5...v1.1.6)
170
+
171
+ ### Fixes
172
+
173
+ - **fix**(index.ts): Fixed exports (2024-07-05) [`7441a0a0c7ffd0cfa802c43060996221060bab03`](https://github.com/vvlad1973/vvlad1973-simple-logger/commit/7441a0a0c7ffd0cfa802c43060996221060bab03)
@@ -1,66 +1,66 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
- import SimpleLogger from '../classes/simple-logger.js';
3
- describe('SimpleLogger', () => {
4
- let consoleSpy;
5
- beforeEach(() => {
6
- consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
7
- });
8
- afterEach(() => {
9
- consoleSpy.mockRestore();
10
- });
11
- it('should log using console when no external logger is provided', () => {
12
- const logger = new SimpleLogger();
13
- logger.info('test message');
14
- expect(consoleSpy).toHaveBeenCalledOnce();
15
- expect(consoleSpy.mock.calls[0][0]).toMatch(/test message/);
16
- });
17
- it('should not log below current level', () => {
18
- const logger = new SimpleLogger(null, { level: 'warn' });
19
- logger.info('should not log');
20
- logger.warn('should log');
21
- expect(consoleSpy).toHaveBeenCalledOnce();
22
- expect(consoleSpy.mock.calls[0][0]).toMatch(/should log/);
23
- });
24
- it('should respect msgPrefix', () => {
25
- const logger = new SimpleLogger(null, { msgPrefix: '[PREFIX]' });
26
- logger.info('message');
27
- expect(consoleSpy.mock.calls[0][0]).toMatch(/\[PREFIX\]/);
28
- });
29
- it('should use external logger methods if provided', () => {
30
- const external = {
31
- info: vi.fn(),
32
- level: 'info',
33
- };
34
- const logger = new SimpleLogger(external);
35
- logger.info('external log');
36
- expect(external.info).toHaveBeenCalledOnce();
37
- expect(external.info).toHaveBeenCalledWith('external log');
38
- });
39
- it('should fallback to console for invalid external logger', () => {
40
- const logger = new SimpleLogger({});
41
- logger.info('fallback');
42
- expect(consoleSpy).toHaveBeenCalled();
43
- });
44
- it('should create child logger with merged bindings', () => {
45
- const logger = new SimpleLogger(null, { bindings: { user: 'A' } });
46
- const child = logger.child({ request: '123' });
47
- child.info('child message');
48
- expect(consoleSpy.mock.calls.length).toBe(1);
49
- const output = consoleSpy.mock.calls[0][0];
50
- expect(output).toMatch(/user=A/);
51
- expect(output).toMatch(/request=123/);
52
- expect(output).toMatch(/child message/);
53
- });
54
- it('should call .child if external logger supports it', () => {
55
- const childFn = vi.fn(() => ({
56
- info: vi.fn(),
57
- level: 'info',
58
- }));
59
- const external = { level: 'info', child: childFn, info: vi.fn() };
60
- const logger = new SimpleLogger(external);
61
- const child = logger.child({ traceId: 'xyz' });
62
- child.info('from child');
63
- expect(childFn).toHaveBeenCalledWith({ traceId: 'xyz' });
64
- });
65
- });
1
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
+ import SimpleLogger from '../classes/simple-logger.js';
3
+ describe('SimpleLogger', () => {
4
+ let consoleSpy;
5
+ beforeEach(() => {
6
+ consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
7
+ });
8
+ afterEach(() => {
9
+ consoleSpy.mockRestore();
10
+ });
11
+ it('should log using console when no external logger is provided', () => {
12
+ const logger = new SimpleLogger();
13
+ logger.info('test message');
14
+ expect(consoleSpy).toHaveBeenCalledOnce();
15
+ expect(consoleSpy.mock.calls[0][0]).toMatch(/test message/);
16
+ });
17
+ it('should not log below current level', () => {
18
+ const logger = new SimpleLogger(null, { level: 'warn' });
19
+ logger.info('should not log');
20
+ logger.warn('should log');
21
+ expect(consoleSpy).toHaveBeenCalledOnce();
22
+ expect(consoleSpy.mock.calls[0][0]).toMatch(/should log/);
23
+ });
24
+ it('should respect msgPrefix', () => {
25
+ const logger = new SimpleLogger(null, { msgPrefix: '[PREFIX]' });
26
+ logger.info('message');
27
+ expect(consoleSpy.mock.calls[0][0]).toMatch(/\[PREFIX\]/);
28
+ });
29
+ it('should use external logger methods if provided', () => {
30
+ const external = {
31
+ info: vi.fn(),
32
+ level: 'info',
33
+ };
34
+ const logger = new SimpleLogger(external);
35
+ logger.info('external log');
36
+ expect(external.info).toHaveBeenCalledOnce();
37
+ expect(external.info).toHaveBeenCalledWith('external log');
38
+ });
39
+ it('should fallback to console for invalid external logger', () => {
40
+ const logger = new SimpleLogger({});
41
+ logger.info('fallback');
42
+ expect(consoleSpy).toHaveBeenCalled();
43
+ });
44
+ it('should create child logger with merged bindings', () => {
45
+ const logger = new SimpleLogger(null, { bindings: { user: 'A' } });
46
+ const child = logger.child({ request: '123' });
47
+ child.info('child message');
48
+ expect(consoleSpy.mock.calls.length).toBe(1);
49
+ const output = consoleSpy.mock.calls[0][0];
50
+ expect(output).toMatch(/user=A/);
51
+ expect(output).toMatch(/request=123/);
52
+ expect(output).toMatch(/child message/);
53
+ });
54
+ it('should call .child if external logger supports it', () => {
55
+ const childFn = vi.fn(() => ({
56
+ info: vi.fn(),
57
+ level: 'info',
58
+ }));
59
+ const external = { level: 'info', child: childFn, info: vi.fn() };
60
+ const logger = new SimpleLogger(external);
61
+ const child = logger.child({ traceId: 'xyz' });
62
+ child.info('from child');
63
+ expect(childFn).toHaveBeenCalledWith({ traceId: 'xyz' });
64
+ });
65
+ });
66
66
  //# sourceMappingURL=simple-logger.test.js.map