fab icon indicating copy to clipboard operation
fab copied to clipboard

Consistent logging errors and warnings

Open hiker opened this issue 1 year ago • 1 comments

Currently errors and warnings are recorded in different ways: (1) using logger (2) warnings.warn (3) print statements

Print statements would not go into the log.txt file generated by FAB, therefore resulting in losing error or warning information for debugging. An example of this is: https://github.com/hiker/fab_new/blob/282f068420577e9b6065fd086cc879124c1d86ba/source/fab/steps/analyse.py#L268C9-L268C15 I once had this error because of not having clang available for c file analysis. However, this error did not get into the log.txt file. The reported error in the log.txt file is key error of lookup in https://github.com/MetOffice/fab/blob/282f068420577e9b6065fd086cc879124c1d86ba/source/fab/mo.py#L37. It was not obvious to me at first instinct that this key error was due to the analysis failure earlier. I had to go through some extensive debugging steps locally to find this out.

It would be good if the error and warning logging can be consistent with using logger.

hiker avatar Nov 25 '24 12:11 hiker

All these points are correct! We've created a top-level ticket to collect together all the logging tickets.

t00sa avatar Aug 05 '25 12:08 t00sa