rigetti / rigetti/qcs-sdk-rust

Simpler logging setup from Python

Open
#503 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
15
Forks
4
Avg merge
1h 9m
Merged PRs (30d)
1

Description

The logging configuration from Python is fairly unwieldy; for instance, this seems to be the simplest way to enable logs that include the job ID:

import logging
logging.basicConfig(level=logging.DEBUG)

class QCSLogFilter(logging.Filter):
    def filter(self, record) -> bool:
        return "qcs.qpu.api" in record.name

for handler in logging.root.handlers:
    handler.addFilter(QCSLogFilter())

It would be nice for the Python SDK package to provide a small number of functions to enable some common logging configurations such as the above, without the kludge of applying a global filter to all logging handlers.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python logging configuration described in crates/python#filtering-logs and inspect the surrounding Python SDK package. Determine the small set of common configurations to expose and how they should avoid global handler filters. Done means the package provides those configurations without requiring the workaround shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.