Closed lorenzoberts closed 1 month ago
Really nice! As we've discussed in #47, I generally agree with the idea and am much obliged for you to go straight to "show me the code" and opening the PR :smiley:
I will review this ASAP. Thanks again :+1:
P.S.: Thanks for the detailed PR explanation with the screenshots.
Hey @lorenzoberts, I've ended up just incorporating the comment I've made and merged it in the unstable branch :+1:
Thank you so much!
This PR creates a macro to log if a result is an error, as discussed in #47 . To exemplify its use case, I applied it to two functions:
download_patchset()
returns error ifb4
is not installed andsplit_patchset()
returns error if there's a problem with the patch set path. Obviously this macro can be applied to multiple existing calls, but the focus of this PR is only adding the macro, so I restricted its usage to these two examples. Below are three examples of how the logs appear in the log file. Note that in the last one I changed the LogLevel to Warning just for creating the example.Besides creating the macro, this PR also reorganizes logging-related elements into separate files (and a dedicated directory) because I felt the logging.rs was getting too large and with things which, in my opinion, would fit better in different files. If you don't think this is necessary, we can simply drop the second commit.