@pandacss/logger 1.9.1 → 1.11.0
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/dist/index.js +8 -0
- package/dist/index.mjs +8 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -199,6 +199,13 @@ var createLogger = (conf = {}) => {
|
|
|
199
199
|
logFns[level2]("hrtime", `${_msg} ${import_kleur.default.gray(`(${ms.toFixed(2)}ms)`)}`);
|
|
200
200
|
};
|
|
201
201
|
};
|
|
202
|
+
const caughtError = (type, context, error) => {
|
|
203
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
204
|
+
logFns.error(type, `${context}: ${message}`);
|
|
205
|
+
if (error instanceof Error && error.stack) {
|
|
206
|
+
logFns.debug(type, error.stack);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
202
209
|
return {
|
|
203
210
|
get level() {
|
|
204
211
|
return level;
|
|
@@ -210,6 +217,7 @@ var createLogger = (conf = {}) => {
|
|
|
210
217
|
onLog = fn;
|
|
211
218
|
},
|
|
212
219
|
...logFns,
|
|
220
|
+
caughtError,
|
|
213
221
|
print(data) {
|
|
214
222
|
console.dir(data, { depth: null, colors: true });
|
|
215
223
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -163,6 +163,13 @@ var createLogger = (conf = {}) => {
|
|
|
163
163
|
logFns[level2]("hrtime", `${_msg} ${colors.gray(`(${ms.toFixed(2)}ms)`)}`);
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
|
+
const caughtError = (type, context, error) => {
|
|
167
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
168
|
+
logFns.error(type, `${context}: ${message}`);
|
|
169
|
+
if (error instanceof Error && error.stack) {
|
|
170
|
+
logFns.debug(type, error.stack);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
166
173
|
return {
|
|
167
174
|
get level() {
|
|
168
175
|
return level;
|
|
@@ -174,6 +181,7 @@ var createLogger = (conf = {}) => {
|
|
|
174
181
|
onLog = fn;
|
|
175
182
|
},
|
|
176
183
|
...logFns,
|
|
184
|
+
caughtError,
|
|
177
185
|
print(data) {
|
|
178
186
|
console.dir(data, { depth: null, colors: true });
|
|
179
187
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/logger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "The core css panda library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"kleur": "4.1.5",
|
|
37
|
-
"@pandacss/types": "1.
|
|
37
|
+
"@pandacss/types": "1.11.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"matcher": "6.0.0"
|