Since the introduction of the CLI arg -L to use a custom log file we are in a somewhat inconsistent state. The Reporter is trying to open the log file after a crash using Filesystem::log_file_path. But since this is accessing a static variable of the Filesystem class it is not enough to just parse the log file in the child process. This one will be lost and the Reporter can not do anything than accessing the default log file.
So, Reporter needs to set the custom log file as well. Here we are a bit in a pickle. I do not want to resort to manually or "old school" CLI arg parsing like the one I just modernized in h2cli. On the other side, we do not want to duplicate all the CLI options in Reporter but we would have to for Qt-style parsing. Else the parser might reject some valid options we missed to add and hydrogen would not start up anymore (unless combined with --child). Therefore, I decided to move all the parsing into a separate class - Parser - used in both places.
Since the introduction of the CLI arg
-L
to use a custom log file we are in a somewhat inconsistent state. TheReporter
is trying to open the log file after a crash usingFilesystem::log_file_path
. But since this is accessing a static variable of theFilesystem
class it is not enough to just parse the log file in the child process. This one will be lost and the Reporter can not do anything than accessing the default log file.So,
Reporter
needs to set the custom log file as well. Here we are a bit in a pickle. I do not want to resort to manually or "old school" CLI arg parsing like the one I just modernized inh2cli
. On the other side, we do not want to duplicate all the CLI options in Reporter but we would have to for Qt-style parsing. Else the parser might reject some valid options we missed to add andhydrogen
would not start up anymore (unless combined with--child
). Therefore, I decided to move all the parsing into a separate class -Parser
- used in both places.