fix: silent fallback to default on any server_config.yml error#43
Open
YuevUwU wants to merge 2 commits intoTeamFlos:mainfrom
Open
fix: silent fallback to default on any server_config.yml error#43YuevUwU wants to merge 2 commits intoTeamFlos:mainfrom
YuevUwU wants to merge 2 commits intoTeamFlos:mainfrom
Conversation
- Use default if server_config.yml is not found with warn log and yaml form of default (as example for users) - Stop if raised other io::Error or serde_yaml::Error - TcpListener -> Server is now TryFrom
485feb9 to
24b3354
Compare
24b3354 to
d180b14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
with
warnlog and yaml form of default (as example for users)io::Errororserde_yaml::ErrorTcpListener->Serveris nowTryFrom"server_config.yml"to a const stringchore: log config.monitors with info!
Past Problem
It's now no longer suppress errors, and users can be aware of their current configuration. (just like phira-monitor)
Mivik can still use without
server_config.ymlfile inphira-mp-server::server::CONFIG_PATH.But other error is now considered as hard error.
Extra Consideration (NOT in this PR)
In my environment, the default max log level is
error.This patch could be considered to "RUST_LOG=warn by default", and still check
RUST_LOGfirst.This is better than simply writing
RUST_LOG=infoin theREADME.md.(Edge Case: If someone set
RUST_LOGas invalid string, it still apply and suppress, and won't usewarnby default.)