forest icon indicating copy to clipboard operation
forest copied to clipboard

Clean up log messages that are sent before the logger is initialized

Open elmattic opened this issue 2 years ago • 5 comments

Issue summary

I think we could have better cli messages, ie:

$ ./target/release/forest --chain=calibnet chain export -r=2000 -s
 2022-08-04T08:35:19.583Z WARN  forest::cli > No configurations found, using defaults.

In this case forest is warning us, but really it should not. I know that I am using the builtin calibnet configuration. Saying he founds nothing is odd from a user perspective at this point. And default could be as well understood as mainnet for a forest dev, which is misleading.

This config message could be much better.

EDIT:

The codebase has now changed and so the issue need to be re-purposed.

Some logs are called before the logger is initialized. We should always log messages once it is initalized.

One log warning is for example happening here. We need to check there are no other ones.

Other information and links

elmattic avatar Aug 04 '22 08:08 elmattic

It's tempting to split the forest node and forest client into two separate programs.

lemmih avatar Sep 08 '22 09:09 lemmih

What would the mission of the forest client? Interacting with the filecoin API?

The geth node somehow does that. You can attach to the node via geth attach then have some js console/repl:

https://geth.ethereum.org/docs/interface/javascript-console

elmattic avatar Sep 08 '22 09:09 elmattic

We already have a node (that connects to the filecoin network) and a client (that communicates with the forest node). They're just bundled in the same executable. If we split them up into two separate executables then it would be easier to make the cli options make sense.

lemmih avatar Sep 08 '22 09:09 lemmih

Note that this issue is really just a user facing ergonomic "problem" (like the warning message is misleading).

Also now we can --detach and run Forest in the background it would be better that all log messages are displayed once detached.

elmattic avatar Sep 08 '22 09:09 elmattic

I'm not sure I understand what you're saying. As I see it, the problem with forest --chain=calibnet chain export is that --chain=calibnet is a flag for the node but we're actually running the client and thus the flag is completely ignored. We have two completely separate tools (the node and the client) that awkwardly share the same cli options and silently ignores the flags that apply to the other tool.

lemmih avatar Sep 08 '22 09:09 lemmih

Closing this issue. It is replaced by smaller, more targeted issues.

lemmih avatar Oct 11 '22 13:10 lemmih