-
Notifications
You must be signed in to change notification settings - Fork 37.8k
[Logging] Only log "Using config file PATH_TO_bitcoin.conf" message on startup if conf file exists #14057
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
[Logging] Only log "Using config file PATH_TO_bitcoin.conf" message on startup if conf file exists #14057
Conversation
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK Perhaps we should get rid of the |
@practicalswift I'm ok with removing the else statement, but the reason I added this is to improve the user experience. Currently a user has no reliable feedback regarding where bitcoind is getting config values. If an invalid conf file path is passed in, bitcoind doesn't tell the user this file doesn't exist and says it's using the file. If we remove the else statement, the user will have no idea if they pass an incorrect path to |
tACK ac7771d4388ca82a4e36fc058cb328b2860ed7c9 on macOS (testing Windows might a good idea). @practicalswift maybe we could hide the “Not using config file” log message if A future update could abort if |
@practicalswift @Sjors the reason i didn't add that extra condition was for the following scenario: A user creates a |
@leishman that makes sense. Perhaps if |
@Sjors I don't think it hurts, as this is a known source of confusion for new users. I've updated with your suggestion and tested on Mac. Anyone have a windows machine they can test on? |
@practicalswift thanks for the suggestions and for catching the typo. I've updated accordingly. |
… exists. Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exists. This commit changes the logic to only display this message if a config file exists and logs a separate message if no config file exists. Additionally, a warning is now logged if the file path passed in the -conf flag does not exist.
utACK 8b5a693db76b70baf5964df3609b5218cc3711a8 |
8b5a693
to
946107a
Compare
@practicalswift @Sjors rebased to clean up commit history |
utACK 946107a |
tACK 946107a Note that |
utACK 946107a |
@laanwj is this good to merge or is there anything else you'd like to see tested? |
utACK 946107a |
… exists. Summary: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exists. This commit changes the logic to only display this message if a config file exists and logs a separate message if no config file exists. Additionally, a warning is now logged if the file path passed in the -conf flag does not exist. This is a backport of Core [[bitcoin/bitcoin#14057 | PR14057]] Test Plan: Run bitcoind and check the output for Config file: /home/deadalnix/.bitcoin/bitcoin.conf (not found, skipping) Reviewers: #bitcoin_abc, nakihito Reviewed By: nakihito Differential Revision: https://reviews.bitcoinabc.org/D5811
… exists. Summary: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exists. This commit changes the logic to only display this message if a config file exists and logs a separate message if no config file exists. Additionally, a warning is now logged if the file path passed in the -conf flag does not exist. This is a backport of Core [[bitcoin/bitcoin#14057 | PR14057]] Test Plan: Run bitcoind and check the output for Config file: /home/deadalnix/.bitcoin/bitcoin.conf (not found, skipping) Reviewers: #bitcoin_abc, nakihito Reviewed By: nakihito Differential Revision: https://reviews.bitcoinabc.org/D5811
…tcoin.conf" message on startup if conf file exists 946107a Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman) Pull request description: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to: **If config file does not exist and no -conf flag passed, log:** `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag. **If config file does not exist and -conf flag passed with incorrect path, log warning:** `Warning: The specified config file FILE_PATH does not exist` **If config file exists, log**: `Config file: FILE_PATH` Note: This is a (modified) subset of changes introduced in bitcoin#13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR. Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
…tcoin.conf" message on startup if conf file exists 946107a Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman) Pull request description: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to: **If config file does not exist and no -conf flag passed, log:** `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag. **If config file does not exist and -conf flag passed with incorrect path, log warning:** `Warning: The specified config file FILE_PATH does not exist` **If config file exists, log**: `Config file: FILE_PATH` Note: This is a (modified) subset of changes introduced in bitcoin#13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR. Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
…tcoin.conf" message on startup if conf file exists 946107a Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman) Pull request description: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to: **If config file does not exist and no -conf flag passed, log:** `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag. **If config file does not exist and -conf flag passed with incorrect path, log warning:** `Warning: The specified config file FILE_PATH does not exist` **If config file exists, log**: `Config file: FILE_PATH` Note: This is a (modified) subset of changes introduced in bitcoin#13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR. Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
…tcoin.conf" message on startup if conf file exists 946107a Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman) Pull request description: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to: **If config file does not exist and no -conf flag passed, log:** `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag. **If config file does not exist and -conf flag passed with incorrect path, log warning:** `Warning: The specified config file FILE_PATH does not exist` **If config file exists, log**: `Config file: FILE_PATH` Note: This is a (modified) subset of changes introduced in bitcoin#13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR. Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
…tcoin.conf" message on startup if conf file exists 946107a Only log "Using PATH_TO_bitcoin.conf" message on startup if conf file exists. (Alexander Leishman) Pull request description: Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to: **If config file does not exist and no -conf flag passed, log:** `Config file: FILE_PATH (not found, skipping)`. Where `FILE_PATH` is the default or the path passed in with the `-conf` flag. **If config file does not exist and -conf flag passed with incorrect path, log warning:** `Warning: The specified config file FILE_PATH does not exist` **If config file exists, log**: `Config file: FILE_PATH` Note: This is a (modified) subset of changes introduced in bitcoin#13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR. Tree-SHA512: be0f0ae6a0c9041e2d6acb54d2563bbcc79786fb2f8bf9a963fe01bc54cd4e388b89079fde1eb79f7f17099776428e5e984bf7107590a3d1ecfc0562dbc6e3f5
Currently we log a message indicating that a bitcoin.conf file is being used even if one does not exist. This PR changes the logic to:
If config file does not exist and no -conf flag passed, log:
Config file: FILE_PATH (not found, skipping)
. WhereFILE_PATH
is the default or the path passed in with the-conf
flag.If config file does not exist and -conf flag passed with incorrect path, log warning:
Warning: The specified config file FILE_PATH does not exist
If config file exists, log:
Config file: FILE_PATH
Note: This is a (modified) subset of changes introduced in #13761 which creates a default example config file. I think it makes sense to extract this small bit out into a separate PR.