You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-on from #31. Now the infrastructure for logging is in place, we can make good use of it with some extensions [feel free to add to this listing, anyone!]:
add meaningful messages across the codebase at applicable levels;
add a verbose kwarg to any function that ends up with a significant amount of log calls.
Improved display in log calls of objects for readability. For example, using pprint.pformat to print dictionary or list structures with an item per line, to make it easy to pick out a particular item especially where the structure has many items so it would otherwise be difficult. I have already changed a few messages in read_write.netcdf.netcdfread as such, e.g:
Currently log messages go, as the equivalent print() statements did, to STDOUT as pure messages i.e. no extra metadata such as datetime stamps are included, just log level, logger name, & the message itself. However I think it would be beneficial to have at least one new handler to provide (all logging messages plus) (date)time stamps, calls made by the user, and exceptions which get raised outside of the logging system.
I think a file handler is best such that the user can specify a path where a named dedicated log file gets written out (& rolled if there is the potential for it to get large enough) with every possible detail (i.e. set cfdm.LOG_LEVEL('DEBUG') for that handler). This would be great for user support & debugging purposes.
for this handler, add functionality to print timestamped calls that are run by the user (not just the log messages themselves).
The text was updated successfully, but these errors were encountered:
Follow-on from #31. Now the infrastructure for logging is in place, we can make good use of it with some extensions [feel free to add to this listing, anyone!]:
Add logging to manage & configure verbose flag logic #31 did not add new logging calls, it simply replaced print calls existing at that point, which only existed on any
equals
methods &read
orwrite
functions. We should:verbose
kwarg to any function that ends up with a significant amount of log calls.Improved display in log calls of objects for readability. For example, using
pprint.pformat
to print dictionary or list structures with an item per line, to make it easy to pick out a particular item especially where the structure has many items so it would otherwise be difficult. I have already changed a few messages inread_write.netcdf.netcdfread
as such, e.g:cfdm/cfdm/read_write/netcdf/netcdfread.py
Lines 670 to 673 in 11fd079
Currently log messages go, as the equivalent
print()
statements did, to STDOUT as pure messages i.e. no extra metadata such as datetime stamps are included, just log level, logger name, & the message itself. However I think it would be beneficial to have at least one new handler to provide (all logging messages plus) (date)time stamps, calls made by the user, and exceptions which get raised outside of the logging system.I think a file handler is best such that the user can specify a path where a named dedicated log file gets written out (& rolled if there is the potential for it to get large enough) with every possible detail (i.e. set
cfdm.LOG_LEVEL('DEBUG')
for that handler). This would be great for user support & debugging purposes.The text was updated successfully, but these errors were encountered: