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
I would like to propose to use the Python's logging feature instead of the print function for logging. This would be nice for users to control levels and destination of the PRIISM log messages. The following changes are what we need to implement the feature.
Add a module logger to each PRIISM submodule:
importlogginglogger=logging.getLogger(__name__)
Replace each print function with a logger method of an appropriate level:
It would also be nice to use the CASA logger. For example, the following code can create a custom log handler that posts a log message to the CASA logger:
Thank you very much for your suggestion. I agree that this is useful feature for users. Although users can take full control over the log messages from Python layer by this change, it might not affect the messages from core library (sparseimaging) written in C++. If that is acceptable, I will work on the proposed improvement.
I would like to propose to use the Python's logging feature instead of the print function for logging. This would be nice for users to control levels and destination of the PRIISM log messages. The following changes are what we need to implement the feature.
Then users can customize logging by adding
basicConfig
at the top of a Python file. For example:It would also be nice to use the CASA logger. For example, the following code can create a custom log handler that posts a log message to the CASA logger:
Click to show the code
Then users can alter the destination of log messages. For example:
Because the updates change many lines of the codes, I'm not going to argue that it should be implemented right away... it is just a personal proposal.
The text was updated successfully, but these errors were encountered: