Skip to content

Commit

Permalink
Only set default_enabled, not enabled, from python init (#1517)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs authored Mar 6, 2023
1 parent 11e1f85 commit 2c03d2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit 2c03d2f

Please sign in to comment.