Skip to content

Conversation

@P-V-SAI-SURAKSHA
Copy link

@P-V-SAI-SURAKSHA P-V-SAI-SURAKSHA commented Jan 6, 2026

Task Description:

  1. smt.py was always using the DEBUG log level, leading to excessive logging of smt.log.
  2. Removed "CRITICAL" handling code from log.py as it is not used anywhere in the codebase.

Solution:
Updated smt.py to read the log level from the configuration file, defaulting to INFO when not set. Logging is now controlled by the configured level, reducing unnecessary log entries and preventing large log files.

@P-V-SAI-SURAKSHA P-V-SAI-SURAKSHA force-pushed the smt_log_level branch 2 times, most recently from 81295a9 to 4cede19 Compare January 7, 2026 16:50
Copy link
Contributor

@Bischoff Bischoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, I tested it to work, but see my remark.

smtLayer/smt.py Outdated
log_level_str = "logging.WARN"
elif level in ("ERROR", "LOGGING.ERROR"):
log_level_str = "logging.ERROR"
elif level in ("CRITICAL", "LOGGING.CRITICAL"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that file log.py contains as well:

        elif log_level in ('LOGGING.CRITICAL', 'CRITICAL'):
            log_level = logging.CRITICAL

but CRITICAL does not appear anywhere in the code, and is not even documented...

What about removing those 2 lines from log.py instead of adding them here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bischoff yes since "CRITICAL" is not used anywhere in the codebase and is not documented I’ve removed the CRITICAL handling from log.py .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I'm a big fan of YAGNI 😛

Signed-off-by: suraksha <p.v.sai.suraksha@ibm.com>
Copy link
Contributor

@Bischoff Bischoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, approving.

@Bischoff
Copy link
Contributor

Bischoff commented Jan 8, 2026

@P-V-SAI-SURAKSHA I am not a "reviewer with write access", so you might need an approval from @mfriesenegger or @Rajat-0 for the automated tests to be green ;) .

@Rajat-0 Rajat-0 self-requested a review January 9, 2026 05:15
@Rajat-0 Rajat-0 merged commit 60a9ed5 into openmainframeproject:master Jan 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants