AstuteSource / chasten

:dizzy: Chasten Uses XML and XPATH to Check a Python Program's AST for Specified Patterns!
https://pypi.org/project/chasten/
GNU General Public License v2.0
7 stars 8 forks source link

Improve logging output of function #111

Closed Jaclynpqc closed 8 months ago

Jaclynpqc commented 8 months ago

This pull request enhances the logging output in the main.py file by strategically placing logger.debug statements in various functions. The improved logging provides detailed information about the execution flow, enabling easier debugging and troubleshooting.

I added logging statements relating to debug info, debug destination, file path directory, current version using: For example,

Display verbose output? False
Debug level? DEBUG
Debug destination? SYSLOG
Current Chasten version 0.2.0
Using XPath version 2.0

I also add more logging statements at key points of the operation that likely going to cause error. I attached a screenshot below, in which you could see two server CONSOLE and SYSLOG run at the same time for chasten analyze. While CONSOLE returns the checked patterns, SYSLOG returns some logging statement and info that might come in handy when troubleshooting and debugging the code:

Screenshot 2023-11-21 at 3 02 12 PM
tuduun commented 8 months ago

@Jaclynpqc Can you please provide the final version of the output and what it looks like? Although I can see the changes in the Files Changed tab, it may be easier for most people to see what it looks like. It may be helpful to display the before and after images of the improved logging system.

AlishChhetri commented 8 months ago

This feature works on a linux device.

Finley8 commented 8 months ago

This feature works on a Windows device!

boulais01 commented 8 months ago

@Jaclynpqc Would you mind posting examples here of the elements @gkapfham requested, so we can close that request change?

Jaclynpqc commented 8 months ago

@gkapfham @boulais01 I have tested and confirmed that my implementation works on all three major OS systems, and on both CONSOLE and SYSLOG. This pull request enhances the logging output in the main.py file by strategically placing logging statements in various functions. The improved logging provides detailed information about the execution flow, enabling easier debugging and troubleshooting.

I added logging statements relating to debug info, debug destination, file path directory, and current version. For example:

Debug level? DEBUG
Debug destination? SYSLOG
Current Chasten version 0.2.0
Using XPath version 2.0

I also added more logging statements at key points of the operation that likely going to cause errors.

Jaclynpqc commented 8 months ago

I have made additional changes to this feature. This PR is now ready to merge

laurennevill commented 8 months ago

Once the changes are resolved, I can merge this

laurennevill commented 8 months ago

Once the changes are resolved, I can merge this

Oops, this also needs one more Professor/TL review