@lelemondev/sdk 0.6.1 → 0.6.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.
- package/dist/express.js.map +1 -1
- package/dist/express.mjs.map +1 -1
- package/dist/hono.js.map +1 -1
- package/dist/hono.mjs.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -8
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.js.map +1 -1
- package/dist/integrations.mjs.map +1 -1
- package/dist/lambda.js.map +1 -1
- package/dist/lambda.mjs.map +1 -1
- package/dist/next.js.map +1 -1
- package/dist/next.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -30,9 +30,8 @@ function traceCapture(provider, model, durationMs, status) {
|
|
|
30
30
|
`${PREFIX} Captured trace: provider=${provider} model=${model} duration=${durationMs}ms status=${status}`
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
function traceCaptureError(provider,
|
|
34
|
-
|
|
35
|
-
console.log(`${PREFIX} Failed to capture trace: provider=${provider} error=${error.message}`);
|
|
33
|
+
function traceCaptureError(provider, err) {
|
|
34
|
+
console.error(`${PREFIX} Failed to capture trace: provider=${provider} error=${err.message}`);
|
|
36
35
|
}
|
|
37
36
|
function clientWrapped(provider) {
|
|
38
37
|
if (!isDebugEnabled()) return;
|
|
@@ -46,10 +45,9 @@ function batchSuccess(count, durationMs) {
|
|
|
46
45
|
if (!isDebugEnabled()) return;
|
|
47
46
|
console.log(`${PREFIX} Batch sent successfully: count=${count} duration=${durationMs}ms`);
|
|
48
47
|
}
|
|
49
|
-
function batchError(count,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
console.log(`${PREFIX} Batch send failed: count=${count} error=${message}`);
|
|
48
|
+
function batchError(count, err) {
|
|
49
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
50
|
+
console.error(`${PREFIX} Batch send failed: count=${count} error=${message}`);
|
|
53
51
|
}
|
|
54
52
|
function requestDetails(method, url, bodySize) {
|
|
55
53
|
if (!isDebugEnabled()) return;
|
|
@@ -217,7 +215,11 @@ function init(config = {}) {
|
|
|
217
215
|
disabled: config.disabled ?? false
|
|
218
216
|
});
|
|
219
217
|
globalTransport = createTransport(config);
|
|
220
|
-
|
|
218
|
+
if (globalTransport.isEnabled()) {
|
|
219
|
+
info("SDK initialized - tracing enabled");
|
|
220
|
+
} else {
|
|
221
|
+
debug("SDK initialized - tracing disabled (no API key or explicitly disabled)");
|
|
222
|
+
}
|
|
221
223
|
}
|
|
222
224
|
function getConfig() {
|
|
223
225
|
return globalConfig;
|