HENDRICS icon indicating copy to clipboard operation
HENDRICS copied to clipboard

Replace Astropy logging with standard Python logging.

Open Sudarshan-21 opened this issue 8 months ago • 3 comments

Fixes issue #102

This PR aims to eliminate the usage of Astropy logging and implement logging using Python's standard logging library.

edit 26/04/2025 As of now, with the current changes, the logging is successfully being done using the standard Python logging module.

Current behaviour can be seen at: HENDRICS/pull/177#issuecomment-2831530914

I need to know the purpose of the commented codes like:

#log.basicConfig(filename='HEN.log', level=log.DEBUG, filemode='w')

in the hendrics/tests/test_a_complete_run.py and similar files, in order to migrate to their new standard logger counterpart.

I would like to hear the inputs and reviews about any missing modifications, or failure of the new logging method.

@matteobachetti @bsipocz @kashish2210 @ankitkhushwaha

Sudarshan-21 avatar Apr 24 '25 03:04 Sudarshan-21

Update 25/04/2025

As of now, the import statements of Astropy logging are replaced with the standard Python logging, and the central logger setup is done successfully. Screenshot from 2025-04-25 22-52-32

The log_to_file attribute from the current code has no direct replacement in the standard Python logging. So, there is a need to create custom functionality to handle those instances.

Screenshot from 2025-04-25 22-52-43

Sudarshan-21 avatar Apr 25 '25 17:04 Sudarshan-21

The logging is working fine!!

Screenshot from 2025-04-26 01-38-19

I would like to hear about any changes in the behaviour or missed instances of logging modification, if any.

Sudarshan-21 avatar Apr 25 '25 22:04 Sudarshan-21

Hey @Sudarshan-21 this PR looks good start to me:) I like the implementation of getlogger() it is really good we can also include in stingray cause it's a good enhancement I have lefted one comment you may refer to that.

@matteobachetti your review required.

kashish2210 avatar Apr 26 '25 01:04 kashish2210