forest
forest copied to clipboard
Clean up log messages that are sent before the logger is initialized
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. Anddefault
could be as well understood asmainnet
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
It's tempting to split the forest node and forest client into two separate programs.
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
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.
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.
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.
Closing this issue. It is replaced by smaller, more targeted issues.