Debugging functions with log macros is very annoying

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia
領域
devtools

調査の方向性

@enter f() を使って issue の例を再現し、n を使って @info 呼び出しをステップ実行します。まず、デバッガーがロギングマクロをどのように処理するかを追跡し、ユーザーの関数に戻る適切な方法を特定します。ロギングコードの内部を手動でたどらずに、そのコードをステップオーバーするか、そこから抜けられれば完了です。

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

説明

For example:

julia> function f()
           x = rand(4)
           @info "hello"
           y = rand(4)
           return x, y
       end
f (generic function with 1 method)

julia> @enter f()
[ Info: Loading Debugger ...
In f() at REPL[1]:1
 1  function f()
>2      x = rand(4)
 3      @info "hello"
 4      y = rand(4)
 5      return x, y
 6  end

About to run: (rand)(4)
1|debug> n
In f() at REPL[1]:1
 382  let
 383      level = $level
 384      # simplify std_level code emitted, if we know it is one of our global constants
 385      std_level = $(level isa Symbol ? :level : :(level isa $LogLevel ? level : convert($LogLevel, level)::$LogLevel))
>386      if std_level >= $(_min_enabled_level)[]
 387          group = $(log_data._group)
 388          _module = $(log_data._module)
 389          logger = $(current_logger_for_env)(std_level, group, _module)
 390          if !(logger === nothing)

About to run: (getindex)(Base.RefValue{Base.CoreLogging.LogLevel}(Debug))

There seems to be no easy way to step out of the logging code so you kinda have to n your way through it...

主要言語
Julia
スター
515
フォーク
50
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

JuliaDebug/Debugger.jl のほかの issue

JuliaDebug/Debugger.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

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

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