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.
##
What this PR does -Adds aLoads config values from an optionalSimulationConfig
struct thatINI
file and overwrites these values if corresponding command line arguments are passed - The config file contains custom values for the simulationini [simln.conf] data_dir = "." sim_file = "sim.json" total_time= print_batch_size = 500 log_level = "info" expected_pmt_amt = 3800000 capacity_multiplier = 2 no_results = false log_interval = 60
- Makes configurable thelog_interval
after which results are logged##
Related Issue(s) - Resolves#157
##
Update - This PR has changed to consider a standard way of handling configuration files as well as command line arguments. It currently introduces functionality to create and parse theCli
from an optionally-provided config file, to merge thisCli
with that parsed from command line arguments, and to grant precedence to the options/values in the latter. - Secondly, this PR also replaces the logging crate fromsimple_logger
toflexi_logger
.flexi_logger
allows dynamic update of log levels after initialization and was required to deal with the issue described here. - Finally, documentation was updated to reflect the introduction and use of a config file. Note: There are some changes to unrelated files because of the requirement to wrap maximum width of code and comments at 120 column spaces. Thought to include them regardless following conversation from#164
on maintaining width.