Skip to content

Conversation

dobrac
Copy link
Contributor

@dobrac dobrac commented Sep 30, 2025

Screenshot 2025-10-01 at 4 07 41 PM

Example usages

The default log level is now INFO

await Template.build(template, {
  alias: 'complex-python-app',
  onBuildLogs: defaultBuildLogger(),
});
await AsyncTemplate.build(
    template,
    alias="complex-python-app",
    on_build_logs=default_build_logger(),
)
Template.build(
    template,
    alias="complex-python-app",
    on_build_logs=default_build_logger({ minLevel: "debug" }),
)

Note

Introduces pretty default build loggers for JS/Python SDKs, emits start/end build logs, and updates CLI templates/tests to use them.

  • SDKs
    • JS SDK (packages/js-sdk):
      • Add defaultBuildLogger with colored output (chalk); new logger.ts.
      • Export LogEntry, LogEntryStart, LogEntryEnd, LogEntryLevel from template and root index.
      • Type updates: onBuildLogs?: (logEntry: LogEntry) => void.
      • TemplateBase.build now emits LogEntryStart/LogEntryEnd and structured info logs.
    • Python SDK (packages/python-sdk):
      • Add default_build_logger with pretty output (rich).
      • Introduce LogEntryLevel, LogEntryStart, LogEntryEnd; export via __init__.
      • Template.build/AsyncTemplate.build emit start/end logs and structured info logs.
      • Add pyrightconfig.json; update deps in pyproject.toml and lockfile.
  • CLI (packages/cli)
    • Templates now pass loggers: TS onBuildLogs: defaultBuildLogger(), Python on_build_logs=default_build_logger().
    • Update expected fixtures accordingly.
  • Tests
    • JS/Python build tests updated to use default logger; setup adjusted for new onBuildLogs signature.
  • Dependencies
    • JS: add chalk.
    • Python: add rich (and new transitive packages).
  • Changeset
    • Patch bumps for @e2b/python-sdk, e2b, and @e2b/cli.

Written by Cursor Bugbot for commit 6f79952. This will update automatically on new commits. Configure here.

@dobrac dobrac added the feature New feature or request label Sep 30, 2025
Copy link

linear bot commented Sep 30, 2025

Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 6f79952

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@e2b/python-sdk Patch
e2b Patch
@e2b/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dobrac dobrac marked this pull request as draft September 30, 2025 14:49
cursor[bot]

This comment was marked as outdated.

@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch from c8dc2b5 to 4f5daa9 Compare September 30, 2025 15:22
@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch 4 times, most recently from d497313 to af5ab11 Compare October 1, 2025 11:46
@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch from af5ab11 to 4c694bc Compare October 1, 2025 12:11
@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch 2 times, most recently from 6fca7e4 to e269bad Compare October 1, 2025 12:33
@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch 3 times, most recently from ad817d7 to 51c3426 Compare October 1, 2025 13:06
@dobrac dobrac force-pushed the pretty-default-logs-for-build-eng-2865 branch from 51c3426 to c3ef49d Compare October 1, 2025 13:56
@dobrac dobrac marked this pull request as ready for review October 1, 2025 14:12
cursor[bot]

This comment was marked as outdated.

timestamp=datetime.now(),
level="info",
message="Waiting for logs...",
message="Build finished",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Build Completion Logging Misleads on Failures

The build method's finally block always emits a "Build finished" log entry, even if an exception occurs during the build. This can be misleading when a build fails.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't have better idea, I'm open to change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant