posit-dev / posit-dev/py-shiny

Enable standard python logging

Open
#727 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
135
Avg merge
2d 18h
Merged PRs (30d)
21

Description

In closed issue #305, @jcheng5 advised against using standard python logging (see below). He comments that "we need to fix up our logging to use logging everywhere". Has this been done, can we now use standard logging? If not, perhaps we should open this as an issue so it can be prioritized and tracked. Sorry if this is already in process or done. Thanks!

         OK, I missed the fact that you were calling `logging.basicConfig`. I'd stop doing that for now--we need to fix up our logging to use `logging` everywhere, but for now you should just do this instead, as early as possible:
import sys
logfile = open('myapp.log', 'a', 1)
sys.stdout = logfile
sys.stderr = logfile

I'd do this before importing any other packages, so import errors will be logged.

Originally posted by @jcheng5 in https://github.com/posit-dev/py-shiny/issues/305#issuecomment-1214673651

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 by reviewing the current logging setup and the discussion in issue #305, including the referenced import-time logging entry point. Determine whether standard Python logging is used consistently across the project and identify the scope of any remaining work. Done means the project has an agreed, tracked approach for using standard logging everywhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.