client; server: use apply_with_log for config patches - #532
Merged
Conversation
|
Code coverage summary for a5e416d: ✅ Region coverage 70% passes |
kp-antonio-yang
force-pushed
the
config-log
branch
3 times, most recently
from
August 28, 2026 04:07
d37bbd9 to
9261e66
Compare
kp-antonio-yang
marked this pull request as ready for review
August 28, 2026 06:16
kp-antonio-yang
marked this pull request as draft
August 31, 2026 01:22
Use `apply_with_log` instead of apply when loading config patches so each field that actually receives a value is tracked. At startup and config reloading, emit a single debug line per source (file, env, CLI) listing only the fields that were set. The internal `unknowns` field is excluded from logging since it is handled separately by validate(). Example: ```log DEBUG config file set: server, cipher, ... DEBUG environment var: log_level, accept_unknowns DEBUG commandline arg: mode ``` Bumps struct-patch to 0.14.1 for apply_with_log support.
kp-antonio-yang
force-pushed
the
config-log
branch
5 times, most recently
from
September 1, 2026 01:47
59a9370 to
6146247
Compare
- Add Config::cli_options() via OnceLock so ConfigPatch::parse() runs
once and is shared between startup and reload paths
- Config::load(config_file: Option<&PathBuf>) is now async: None
resolves the path from cli_options. The config_file can be used
on reload_config with any new path to config file if needed.
- Env-var, CLI and logs are handled inside load() and keep DRY
Move all config-loading logic out of main() and into Config::load(), so the flow between server and client will be the same and good for maintains.
kp-antonio-yang
force-pushed
the
config-log
branch
from
September 1, 2026 02:23
6146247 to
1bd5ccc
Compare
kp-antonio-yang
marked this pull request as ready for review
September 1, 2026 02:42
kp-mariappan-ramasamy
approved these changes
Sep 1, 2026
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.
Description
Add the log and eliminate duplicated loading logic across client and server and keep DRY.
Log config fields by source at startup
Switch from
applytoapply_with_logwhen loading config patches soeach field that actually receives a value is tracked. At startup and on
config reload, emit one debug line per source listing only the fields
that were set. The internal
unknownsfield is excluded since it ishandled separately by
validate().Consolidate config loading into
Config::load()Move all loading logic out of
main()into a singleConfig::load()method, making
main()cleaner and the reload path trivial.Motivation and Context
Add log for config patching. Meanwhile, centralizing this in
Config::load()removes the duplication to avoidHow Has This Been Tested?
Types of changes
Checklist:
main