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

Using the status module across large workspaces #480

Open
0o-de-lally opened this issue Apr 6, 2021 · 0 comments
Open

Using the status module across large workspaces #480

0o-de-lally opened this issue Apr 6, 2021 · 0 comments

Comments

@0o-de-lally
Copy link

I've been using abscissa in several apps in a large workspace with other non-abscissa apps. I'd like to use the status.rs in those other apps, or in common libraries. This means instantiating Streams before using status_info! directly in the non-abscissa module.

However that means abscissa apps will fail with "terminal streams already initialized!". Would be nice if status didn't have a panic when the terminal is already initialized, or perhaps reusing.

/// Initialize the terminal subsystem, registering the [`Streams`] static
pub(crate) fn init(color_choice: ColorChoice) {
STREAMS
.set(Streams::new(color_choice))
.unwrap_or_else(|_| panic!("terminal streams already initialized!"));
}

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

No branches or pull requests

1 participant