Closed gventuri closed 1 month ago
Attention: Patch coverage is 44.44444%
with 15 lines
in your changes are missing coverage. Please review.
Project coverage is 78.48%. Comparing base (
2502d04
) to head (a4f64e7
).
Files | Patch % | Lines |
---|---|---|
pandasai/helpers/logger.py | 44.44% | 15 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Refactors logging behavior in Logger
class to correctly handle verbose
and save_logs
settings.
filaname
to filename
for more accurate file handling.verbose
is True or the log level is above INFO, addressing the issue where verbose mode did not print anything.verbose
property setter to clear all handlers before adding a new StreamHandler, ensuring that toggling the verbose flag works as expected.save_logs
property setter and getter to correctly identify and manage FileHandler instances, preventing logs from being added to pandasai.log
when save_logs
is False.For more details, open the Copilot Workspace session.
Related to #1167
Updates the Logger class in
pandasai/helpers/logger.py
to respect theverbose
andsave_logs
settings more accurately.__init__
method to conditionally addlogging.StreamHandler(sys.stdout)
only ifverbose
is True, ensuring that logs are not printed to the console whenverbose
is False.log
method to check the_verbose
attribute before logging messages to the console, allowing for more granular control over what gets logged based on the verbosity level.save_logs
setter and getter methods to accurately reflect whether logs are being saved to a file, addressing the issue where logs were saved regardless of thesave_logs
setting.filaname
tofilename
in both the__init__
method and thesave_logs
setter, improving code readability and consistency.For more details, open the Copilot Workspace session.