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

Use Config File to Drive Components Log Configuration #1851

Merged
merged 46 commits into from
Sep 7, 2022
Merged

Conversation

tyshko5
Copy link
Contributor

@tyshko5 tyshko5 commented Aug 23, 2022

Summary of changes
Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes #1520

Other information and links

@tyshko5 tyshko5 marked this pull request as ready for review August 24, 2022 07:50
Copy link
Contributor

@lemmih lemmih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's some confusion here. The --log-file flag is for directing log messages to a file rather than stdout. It shouldn't read a log configuration from that file.

The LogConfig should be part of the regular configuration file. And those log options shouldn't be an alternative to the default options, they should just be applied after the default options have been set.

@tyshko5
Copy link
Contributor Author

tyshko5 commented Aug 24, 2022

I think there's some confusion here. The --log-file flag is for directing log messages to a file rather than stdout. It shouldn't read a log configuration from that file.

The LogConfig should be part of the regular configuration file. And those log options shouldn't be an alternative to the default options, they should just be applied after the default options have been set.

Second part is fixed, but the logger we are using, pretty_env_logger, doesn't have a feature to save logs to a file. Should we change the logger?

@tyshko5 tyshko5 requested a review from lemmih August 24, 2022 11:09
Copy link
Contributor

@lemmih lemmih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting closer. Still need the --log-file flag (or a comment saying why it isn't possible).

forest/src/logger/mod.rs Outdated Show resolved Hide resolved
forest/src/main.rs Outdated Show resolved Hide resolved
forest/src/main.rs Show resolved Hide resolved
@tyshko5
Copy link
Contributor Author

tyshko5 commented Aug 24, 2022

Getting closer. Still need the --log-file flag (or a comment saying why it isn't possible).

the logger we are using, pretty_env_logger, doesn't have a feature to save logs to a file. Should we change the logger?

@tyshko5 tyshko5 requested a review from lemmih August 24, 2022 11:57
@lemmih
Copy link
Contributor

lemmih commented Aug 24, 2022

Getting closer. Still need the --log-file flag (or a comment saying why it isn't possible).

the logger we are using, pretty_env_logger, doesn't have a feature to save logs to a file. Should we change the logger?

pretty_env_logger is layered on top of env_logger. You can get the Builder for env_logger and then change the target.

@tyshko5
Copy link
Contributor Author

tyshko5 commented Aug 24, 2022

Getting closer. Still need the --log-file flag (or a comment saying why it isn't possible).

the logger we are using, pretty_env_logger, doesn't have a feature to save logs to a file. Should we change the logger?

pretty_env_logger is layered on top of env_logger. You can get the Builder for env_logger and then change the target.

The only targets that can be used by env_logger are stdout and stderr

@lemmih
Copy link
Contributor

lemmih commented Aug 24, 2022

Getting closer. Still need the --log-file flag (or a comment saying why it isn't possible).

the logger we are using, pretty_env_logger, doesn't have a feature to save logs to a file. Should we change the logger?

pretty_env_logger is layered on top of env_logger. You can get the Builder for env_logger and then change the target.

The only targets that can be used by env_logger are stdout and stderr

Ah, the Pipe option was added at a later time. Add an entry for --log-file to the configuration and comment it out. Then write a comment describing why it cannot yet be implemented (and link to seanmonstar/pretty-env-logger#52).

forest/src/cli/config.rs Outdated Show resolved Hide resolved
forest/src/cli/mod.rs Outdated Show resolved Hide resolved
forest/src/cli/mod.rs Outdated Show resolved Hide resolved
forest/src/cli/mod.rs Outdated Show resolved Hide resolved
@tyshko5 tyshko5 requested a review from lemmih August 24, 2022 14:38
tyshko5 and others added 18 commits September 7, 2022 10:32
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
* add flag to cliopts

* and options to config

* move exit logig to sync_from_snapshot

* rename to match lotus cli

* changes for testing; move halt to after import chain

* verify that rocksdb is dropped

* requested changes and remove testing logs

* move comment

* default rocks log level debug -> warn

* fix workflow errors
…1816)

Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
Co-authored-by: Hubert <hubert@chainsafe.io>
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
* most changes

* requested change

* fix fmt

* new ways: delete claus, version_schedule, sort

* fix lint

* requested changes

* compile time check

* from implementation

* requested changes

* requested changes

* requested changes

* requested changes

* requested changes

* delete Claus from deleg cns config
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
@lemmih lemmih disabled auto-merge September 7, 2022 08:55
Copy link
Contributor

@lemmih lemmih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something definitely went wrong while resolving conflicts.

@lemmih
Copy link
Contributor

lemmih commented Sep 7, 2022

@tyshko5 The dictionary is still wrong. Look at the changes to see why.

@tyshko5 tyshko5 requested a review from lemmih September 7, 2022 09:34
.config/forest.dic Outdated Show resolved Hide resolved
@tyshko5 tyshko5 requested a review from lemmih September 7, 2022 09:58
@lemmih lemmih merged commit 0198492 into main Sep 7, 2022
@lemmih lemmih deleted the tyshko5/issue-1520 branch September 7, 2022 10:04
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

Successfully merging this pull request may close these issues.

Use Config File to Drive Components Log Configuration
8 participants