Skip to content
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

Allow setting log level for mindev ruletype test #3119

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Apr 16, 2024

Summary

I was debugging a ruletype change and found it handy to have the engine
debug logs dumped onto the console.

This patch adds a new parameter --log-level that defaults to error
and lets you set the log level for the evaluation of the engine.

Change Type

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

AUTH_TOKEN=topsecret REGO_ENABLE_PRINT=true go run cmd/dev/main.go ruletype test --profile /Users/jakub/devel/playground/codeql-python.yaml --rule-type /Users/jakub/devel/minder-rules-and-profiles/rule-types/github/codeql_enabled.yaml --entity /Users/jakub/devel/playground/repository.yaml --log-level=debug

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

I was debugging a ruletype change and found it handy to have the engine
debug logs dumped onto the console.

This patch adds a new parameter `--log-level` that defaults to `error`
and lets you set the log level for the evaluation of the engine.
@jhrozek jhrozek requested a review from a team as a code owner April 16, 2024 19:30
@coveralls
Copy link

Coverage Status

coverage: 48.193% (+0.01%) from 48.181%
when pulling 1aab9fc on jhrozek:mindev_logger
into c77ed44 on stacklok:main.

@jhrozek jhrozek merged commit fc3afce into mindersec:main Apr 17, 2024
21 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