google / gcp_scanner

A comprehensive scanner for Google Cloud
Apache License 2.0
305 stars 95 forks source link

added log config and replaced print with log #235

Closed rjarun8 closed 1 year ago

rjarun8 commented 1 year ago

Description

I have replaced the print() function with the logging.info() function in the scanner.py file. This change allows the program to output log messages with timestamps, which is useful for tracking the progress of long-running scans.

Changes Made

Checklist

Related Issues

Additional Notes

This change should make it easier to track the progress of long-running scans. The log messages now include a timestamp, which can be helpful for understanding when each event occurred. I have not added any new tests or updated the documentation, as I believe these changes are self-explanatory and do not significantly alter the functionality of the program.

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

mshudrak commented 1 year ago

Please accept Google's CLA in order to proceed.

rjarun8 commented 1 year ago

Please accept Google's CLA in order to proceed.

Accepted

mshudrak commented 1 year ago

Just noticed activity in this PR, sorry for not replying later. Like I mentioned in the comment, I left it to be print and not logging.info on purpose. Otherwise GCP Scanner is completely silent and user has 0 idea of what's going on and whether it is working at all. We either need to have another level of verbosity that's printing some basic level of information in terminal or just leave as it is now with print.

ZetaTwo commented 1 year ago

Why can't we set the default level to info and use logging?

mxmssh commented 1 year ago

In this case, it generates too much info and terminal is overloaded with text...

On Mon, Jul 17, 2023, 11:41 AM Calle Svensson @.***> wrote:

Why can't we set the default level to info and use logging?

— Reply to this email directly, view it on GitHub https://github.com/google/gcp_scanner/pull/235#issuecomment-1638678948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUFDYWSN25GLQ3FBSMK4I3XQWBO3ANCNFSM6AAAAAAZ2YTA6E . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ZetaTwo commented 1 year ago

Doesn't that suggest that we should shift a lot of the info messages to debug messages?

mxmssh commented 1 year ago

I'd just use several levels of verbosity as it is usually done in scanners. Debug could be part of that (e.g. last level).

On Mon, Jul 17, 2023, 12:36 PM Calle Svensson @.***> wrote:

Doesn't that suggest that we should shift a lot of the info messages to debug messages?

— Reply to this email directly, view it on GitHub https://github.com/google/gcp_scanner/pull/235#issuecomment-1638754406, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUFDYXHLZNBD4LTNIUUIQ3XQWH4JANCNFSM6AAAAAAZ2YTA6E . You are receiving this because you commented.Message ID: @.***>

mshudrak commented 1 year ago

I am closing this one due to inactivity. TL;DR: we need a logging system with multiple levels of verbosity.