Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

chore(js-sdk): Log session init/termination by default (#156)

Pavel 'Strajk' Dolecek264189165b7c
diff --git a/.changeset/rare-moons-dream.md b/.changeset/rare-moons-dream.md
new file mode 100644
index 000000000..a698745f5
--- /dev/null
+++ b/.changeset/rare-moons-dream.md
@@ -0,0 +1,5 @@
+---
+'@e2b/sdk': patch
+---
+
+Log session init/termination by default
diff --git a/packages/js-sdk/src/session/sessionConnection.ts b/packages/js-sdk/src/session/sessionConnection.ts
index 566bc3566..c6ae32f97 100644
--- a/packages/js-sdk/src/session/sessionConnection.ts
+++ b/packages/js-sdk/src/session/sessionConnection.ts
@@ -72,11 +72,13 @@ export class SessionConnection {
)
}
this.logger = opts.logger ?? {
- // by default, we log to the console, only warnings and errors
+ // by default, we log to the console
+ // we don't log debug messages by default
+ info: console.info,
warn: console.warn,
error: console.error,
}
- this.logger.info?.(`Session for code snippet "${opts.id}" initialized`)
+ this.logger.info?.(`Session "${opts.id}" initialized`)
}
/**