Skip to content

Commit f402705

Browse files
committed
fix pino
1 parent 84e8e21 commit f402705

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@databuddy/sdk",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "Official Databuddy Analytics SDK",
55
"main": "./dist/core/index.mjs",
66
"types": "./dist/core/index.d.ts",

packages/sdk/src/node/logger.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ export interface Logger {
66
}
77

88
export function createLogger(debug = false): Logger {
9-
try {
10-
const pino = require("pino");
11-
return pino({
12-
level: debug ? "debug" : "info",
13-
name: "databuddy",
14-
});
15-
} catch {
16-
return createConsoleLogger(debug);
17-
}
9+
return createConsoleLogger(debug);
1810
}
1911

2012
function createConsoleLogger(debug: boolean): Logger {
21-
const noop = () => {};
13+
const noop = () => { };
2214

2315
return {
2416
info(msg: string, data?: Record<string, unknown>) {
@@ -38,14 +30,14 @@ function createConsoleLogger(debug: boolean): Logger {
3830
},
3931
debug: debug
4032
? (msg: string, data?: Record<string, unknown>) => {
41-
console.debug(`[Databuddy] ${msg}`, data ? JSON.stringify(data) : "");
42-
}
33+
console.debug(`[Databuddy] ${msg}`, data ? JSON.stringify(data) : "");
34+
}
4335
: noop,
4436
};
4537
}
4638

4739
export function createNoopLogger(): Logger {
48-
const noop = () => {};
40+
const noop = () => { };
4941
return {
5042
info: noop,
5143
error: noop,

0 commit comments

Comments
 (0)