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

GUI: Daemon "info" level logs when starting it #475

Open
darosior opened this issue May 4, 2023 · 8 comments · May be fixed by #748
Open

GUI: Daemon "info" level logs when starting it #475

darosior opened this issue May 4, 2023 · 8 comments · May be fixed by #748
Assignees
Labels
Feature New feature or functionality. GUI gui related

Comments

@darosior
Copy link
Member

darosior commented May 4, 2023

On mainnet it takes a few minutes for my bitcoind to load the watchonly wallet. Therefore the GUI stays stuck at the following screen with no apparent progress.
image

I think it would be nice to display the daemon info-level logs to let the user know there is actual progress.

@darosior darosior added GUI gui related Feature New feature or functionality. labels May 4, 2023
@darosior darosior moved this to Nice to have in Liana v2 Jul 24, 2023
darosior added a commit that referenced this issue Aug 28, 2023
5c87937 Add more bitcoind-related setup logging (Antoine Poinsot)

Pull request description:

  At startup it sometimes appear we may be hanging when setting up bitcoind. Add more logging to give more information about what's taking long to setup (for instance, loading the watchonly wallet).

  Related to #475.

ACKs for top commit:
  darosior:
    ACK 5c87937

Tree-SHA512: 75c553cabf545d57a5fc2d251e5b4cd880a931a408c6f1b1052067f2ccc8e0728ad779f30de5a88c2566f9e67ac085b713393ee4fa193331e49c3a8e6112ecc8
@darosior darosior removed this from Liana v2 Aug 29, 2023
@darosior darosior moved this to Nice to have in Liana v3 Aug 29, 2023
@darosior darosior moved this from Nice to have to Todo in Liana v3 Sep 11, 2023
@darosior darosior moved this from Todo to In Progress in Liana v3 Oct 24, 2023
@jp1ac4
Copy link
Collaborator

jp1ac4 commented Oct 25, 2023

I think it would be nice to display the daemon info-level logs to let the user know there is actual progress.

I'm not sure how best to approach this. Would it be reading the stdout somehow and displaying that? Or perhaps adding a log dispatcher that filters for info-level logs?

@darosior
Copy link
Member Author

I was thinking of a log dispatcher, but i'm not sure either. @edouardparis any idea?

@edouardparis
Copy link
Member

The way I see it, in gui/src/logger.rs:
Make a struct wrapping a mpsc channel sender, lets call it LogStream
make it implement tracing_subsriber::Layer
something like:

struct LogStream {
    sender: mpsc::Sender<String>,
}

impl<S> Layer<S> for LogStream
where
    S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>,
{
    fn on_event(&self, event: &Event<'_>, _ctx: Context<'_, S>) {
        if let Some(message) = event.message().map(ToString::to_string) {
            let _ = self.sender.send(message);
        }
    }
}
   let (sender, receiver) = mpsc::channel::<String>();
    tracing_subscriber::registry().with(LogStream{ sender });

the mpsc channel receiver is then passed to loader to listen from it in a subscription.

@darosior
Copy link
Member Author

If that's too convoluted, not doing it is also an option.

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Oct 25, 2023

Thanks very much for the suggestion. I'll give that a try and see how it goes.

@jp1ac4
Copy link
Collaborator

jp1ac4 commented Oct 26, 2023

I've been able to make progress and display some log output on the screen. Once I've tidied things up, I'll create a draft PR to get initial feedback.

@darosior
Copy link
Member Author

Ok, thanks for the update.

@jp1ac4 jp1ac4 linked a pull request Oct 26, 2023 that will close this issue
@jp1ac4
Copy link
Collaborator

jp1ac4 commented Oct 26, 2023

I've created #748 for some initial feedback to make sure I'm on the right track. Thanks.

@darosior darosior removed this from Liana v3 Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or functionality. GUI gui related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants