Skip to content

refactor: simplify structlog and use structlog.get_logger directly#1300

Merged
dbasunag merged 2 commits intoopendatahub-io:mainfrom
jgarciao:simplify-structlog-config
Mar 25, 2026
Merged

refactor: simplify structlog and use structlog.get_logger directly#1300
dbasunag merged 2 commits intoopendatahub-io:mainfrom
jgarciao:simplify-structlog-config

Conversation

@jgarciao
Copy link
Copy Markdown
Contributor

Consolidate logging into utilities/logger.py: ProcessorFormatter with ConsoleRenderer (console) and JSONRenderer (file), configure_structlog() in setup_logging(), and _StructlogQueueHandler so event dicts survive the queue.

Remove utilities/opendatahub_logger.py. Replace get_logger() wrapper with import structlog and structlog.get_logger(name=name) across tests and utilities.

Made-with: Cursor

@github-actions
Copy link
Copy Markdown

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/hold', '/verified', '/wip', '/lgtm', '/build-push-pr-image', '/cherry-pick'}

dbasunag
dbasunag previously approved these changes Mar 25, 2026
Consolidate logging into utilities/logger.py: ProcessorFormatter with
ConsoleRenderer (console) and JSONRenderer (file), configure_structlog() in
setup_logging(), and _StructlogQueueHandler so event dicts survive the queue.

Remove utilities/opendatahub_logger.py. Replace get_logger() wrapper with
import structlog and structlog.get_logger(name=__name__) across tests and
utilities.

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
Made-with: Cursor
Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
@jgarciao jgarciao requested a review from dbasunag March 25, 2026 16:33
Copy link
Copy Markdown
Contributor

@Bobbins228 Bobbins228 left a comment

Choose a reason for hiding this comment

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

/lgtm

kpunwatk
kpunwatk previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@kpunwatk kpunwatk left a comment

Choose a reason for hiding this comment

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

/lgtm

dbasunag
dbasunag previously approved these changes Mar 25, 2026
Eliminate the --readable-logs CLI option from the logging configuration
and related documentation. Update the logging setup to use structured JSON
format by default, while clarifying the log output format in the
GETTING_STARTED.md file.

Signed-off-by: Jorge Garcia Oncins <jgarciao@redhat.com>
Copy link
Copy Markdown
Contributor

@fege fege left a comment

Choose a reason for hiding this comment

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

/lgtm

@jgarciao jgarciao enabled auto-merge (squash) March 25, 2026 16:56
@dbasunag dbasunag disabled auto-merge March 25, 2026 16:57
@dbasunag dbasunag merged commit 8a67a44 into opendatahub-io:main Mar 25, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown

Status of building tag latest: success.
Status of pushing tag latest to image registry: success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants