Skip to content

Fix logging across modules #268

Closed
Closed
@kmcquade

Description

@kmcquade

Right now, we use click_log to set the log formatter. However, I noticed that the logger only shows up when it is in the command file - like policy_sentry.command.write_policy, but not policy_sentry.writing.sid_group

For example, running write policy with the minimize command like this:

policy_sentry write-policy --input-file examples/yml/crud-with-wildcard.yml --minimize 0 -v debug

In the command above, there are no debug messages that show up but a lot of them should show up.

For example, the write-policy command leverages the policy_sentry.write_policy.sid_group.SidGroup class here, but if you look at the actual sid_group.py file, you will see that there are a lot of other lines with logger.debug(). But these logging messages do not show up.

For example:

if minimize is not None and isinstance(minimize, int):
logger.debug("Minimizing statements...")
actions = minimize_statement_actions(
actions, all_actions, minchars=minimize
)

If you have any experience with setting the Python log formatter across multiple modules, I would really appreciate help on this one.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions