Closed dcookspi closed 3 months ago
Still can't have 2 reviewers on PRs. So @rydrman, @jrray mentioning you both here, so you see this one.
Going to add env vars and a way to control the file logging verbosity for solvers. We want to be able to set env var so CI jobs all log to files at a minimal verbosity that will be useful for tracing issues.
Updated to have a minimum verbosity when outputting to files is enabled. Changed over to output to dir and ot take a directory path to the place the solver files will be written to. Added subsecond time numbers to the filenames to cope with multiple solver runs in the same second. Changes output file creation to catch existing file issues and try again with a different file name. Added --output-file-prefix and an env var to allow the first part of the filename to overridden.
Adds
--output-to-dir <path>
flag for logging each solver's output to a separate file for each solver run, and theSPK_OUTPUT_TO_DIR
env avr. The output files will be put in the given path.It extends the
OutputKind
enum to have entries that output to a file, orprintln!
and a file, ortracing!
and a file. The interface allows for anything with theWrite
trait (and some thread-safe/task required traits). TheCopy
trait was removed from the enum in favour of cloning while wrangling the tasks, threads, mutability, and task communication messages. Let me know if there's a better way to do this.A method was added to the enum to allow the initial output kind, i.e.
Println
orTracing
, to be combined with an output to file enum entry. This is used to make things appear in the right places when a background solver finishes the solve first and needs to print the solve results for the user (Installed Packages: ...
).The solve output files are named with the date and time the solve started, and the name of the kind of solver, e.g.
<path>
/spk_solver_run_20240704_131234_12004596_Unchanged
<path>
/spk_solver_run_20240704_131234_23142152_All-Impossible-Checks
The verbosity level is increased to at least 2 when
--output-to-dir ...
is used. This helps ensure the files contain enough solver information to be useful when debugging issues. This minimum verbosity level is configurable via--output-to-dir-min-verbosity <n>
or theSPK.SPK_OUTPUT_TO_DIR_MIN_VERBOSITY
env var).