Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default_enabled correctly in python init #1517

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/re_sdk/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ impl Session {
self.enabled = enabled;
}

/// Set whether or not logging is enabled by default.
/// This will be overridden by the `RERUN` environment variable, if found.
pub fn set_default_enabled(&mut self, default_enabled: bool) {
self.enabled = crate::decide_logging_enabled(default_enabled);
}

/// Set the [`ApplicationId`] to use for the following stream of log messages.
///
/// This should be called once before anything else.
Expand Down
2 changes: 1 addition & 1 deletion rerun_py/src/python_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ fn init(application_id: String, application_path: Option<PathBuf>, default_enabl
// HOTFIX: Currently, the session is already fetched when initializing the bindings, and so
// `default_enabled` has already been set... we need to overwrite it if the user calls `init`
// manually.
session.set_enabled(default_enabled);
session.set_default_enabled(default_enabled);

session.set_application_id(ApplicationId(application_id), is_official_example);
}
Expand Down