electrs icon indicating copy to clipboard operation
electrs copied to clipboard

Feature: Better logging to stdout/stderr on first startup

Open LLFourn opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe.

There is very little feedback when starting electrs for the first time even when -v is used.

Describe the solution you'd like I would like electrs to at least tell me that it's working e.g. able to contact bitcoind and get blocks etc.

Additional context Currently when starting electrs for the first time the only output you get to stdout/stderr is a Debug dump of the Config data. I can see from top that stuff is happening between it and bitcoind but nothing whatsoever is logged.

LLFourn avatar Dec 21 '20 01:12 LLFourn

So I think the two things that got me were:

  1. This eprintln: https://github.com/romanz/electrs/blob/master/src/config.rs#L284 confused me. Since I was getting something to stderr I thought that I was actually getting logs.

  2. https://github.com/romanz/electrs/blob/5ef12d407520e22f46aaa726716424fcf233b94f/doc/config_example.toml#L35 should be "verbose = 3" not verbosity (for it to work).

LLFourn avatar Dec 21 '20 22:12 LLFourn

I would consider using a default logging level of INFO when -v isn't specified, increase it to DEBUG with one -v and to VERBOSE with two. I did something similar in bwt.

shesek avatar Dec 31 '20 09:12 shesek

@shesek this is currently not supported by configure_me. I will try to look into it, should be quite easy. It will just take some time.

Meanwhile fixed config example should help.

Kixunil avatar Feb 04 '21 22:02 Kixunil

@shesek ah, I misunderstood what you said. This is possiible, I believe, but I'd also introduce -q option to make it quieter.

In a way this is a breaking change as it'll suddenly behave differently. I'm not sure what to do about it.

Kixunil avatar Feb 05 '21 13:02 Kixunil

It seems to be a breaking change with very slim chances of actually breaking something. Like if someone was not using -v and relied on having no STDERR output for some scripting, which doesn't seem likely. But then again, you never know....

shesek avatar Feb 05 '21 17:02 shesek

I'm more concerned about users having -vv which is now info if I remember correctly and then it'd become trace and fill the logs.

Kixunil avatar Feb 05 '21 23:02 Kixunil