Skip to content

logging regression: fix loglines/findCaller introspection #68042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattp-
Copy link
Contributor

@mattp- mattp- commented May 28, 2025

What does this PR do?

python 3.8 changed the way it was inferring loglines from the callstack; the stacklevel was exposed as a way around this to tell logging to ignore an arbitrary level of frames ontop of the 1 it knows about.

I tried writing a test but for whatever reason caplog / salt-test-factories doesn't exhibit the same behavior as directly running via CLI. this should be easily reproducible though.

Previous Behavior

15:09:46,213 DEBUG 2576238 salt.config:289 Reading configuration from /home/mphillips81/repos/upstream-salt/etc/salt/master
15:09:46,220 WARNING 2576238 salt.config:289 Cluster peers defined without a cluster_id, ignoring.
15:09:46,222 WARNING 2576238 salt.utils.verify:289 Insecure logging configuration detected! Sensitive data may be logged.
15:09:46,228 DEBUG 2576238 salt.utils.parsers:289 Configuration file path: /home/mphillips81/repos/upstream-salt/etc/salt/master
15:09:46,230 INFO 2576238 salt.cli.daemons:289 Setting up the Salt Master
15:09:46,251 DEBUG 2576238 salt.utils.decorators.jinja:289 Marking 'base64_encode' as a jinja filter

note the 289

New Behavior

15:08:35,246 DEBUG 2575840 salt.config:2053 Reading configuration from /home/mphillips81/repos/upstream-salt/etc/salt/master
15:08:35,255 WARNING 2575840 salt.config:4137 Cluster peers defined without a cluster_id, ignoring.
15:08:35,258 WARNING 2575840 salt.utils.verify:599 Insecure logging configuration detected! Sensitive data may be logged.
15:08:35,267 DEBUG 2575840 salt.utils.parsers:222 Configuration file path: /home/mphillips81/repos/upstream-salt/etc/salt/master
15:08:35,270 INFO 2575840 salt.cli.daemons:82 Setting up the Salt Master

correct log lines

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

python 3.8 changed the way it was inferring loglines from the callstack;
the stacklevel was exposed as a way around this to tell logging to
ignore an arbitrary level of frames ontop of the 1 it knows about.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants