plotly / plotly/plotly.py

Log messages appearing twice with Python Logging after pio.renderers.default = "notebook"

オープン
#5,247 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P2
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

After importing plotly.io and setting the pio.renderers.default = "notebook" in my Python code, All Log messages appearing twice with Python Logging

python version: 3.9.12
plotly version: 6.1.2

import logging

# create logger
logger = logging.getLogger('simple_example')
logger.setLevel(logging.DEBUG)

# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

# create formatter
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

# add formatter to ch
ch.setFormatter(formatter)

# add ch to logger
logger.addHandler(ch)

## print some message
logger.info("hello test")    #### till this point all looks good

## now import plotly
import plotly.io as pio
pio.renderers.default = "notebook"

## use the logger again , now the same logger.info printing the log message twice
logger.info("hello test after import")

Image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue の Python logging の例を実行します。特に、plotly.io の import と pio.renderers.default を "notebook" に設定する部分を確認してください。renderer のセットアップと logging handler を追跡して、2 回目の logger.info 呼び出しが 2 回出力される理由を特定します。notebook renderer の選択後にメッセージが 1 回だけ表示され、その動作がリグレッションテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, plotly, python
領域
observability
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。