Ruby 1.9.2 リファレンスマニュアル > ライブラリ一覧 > tracerライブラリ > Tracerクラス

class Tracer

クラスの継承リスト: Tracer < Object < Kernel < BasicObject

要約

実行トレース出力をとる機能を提供するクラスです。

特異メソッド

定義 説明
add_filter(proc)
add_filter {|event, file, line, id, binding, klass| .... }

トレース出力するかどうかを決定するフィルタを追加します。 何もフィルタを与えない場合はすべての行についてトレース情報が出力されます。 与えられた手続き(ブロックまたはProcオブジェクト)が真を返せば トレースは出力されます。

display_c_call -> bool
display_c_call? -> bool

真ならば、ビルトインメソッドの呼び出しを表示します。 デフォルトは偽です。

display_c_call=(flag)

ビルトインメソッドの呼び出しを表示するかどうかを設定します。

display_process_id -> bool
display_process_id? -> bool

真ならば、プロセス ID を表示します。 デフォルトは、偽です。

display_process_id=(flag)

プロセス ID を表示するかどうかを設定します。

display_thread_id -> bool
display_thread_id? -> bool

真ならば、スレッド ID を表示します。 デフォルトは、真です。

display_thread_id=(flag)

スレッド ID を表示するかどうかを設定します。

new

自身を初期化します。

off -> nil

トレース出力を中断します。 トレース出力を開始するには、Tracer.onを使用します。

on -> nil
on {...}

トレース出力を開始します。 ブロックを与えられた場合はそのブロック内のみトレース出力を行います。

set_get_line_procs(filename, proc)
set_get_line_procs(filename) {|line| .... }

あるファイルについて利用する、行番号からソースのその行の内容を返す 手続きを指定する。何も指定しなければデフォルトの動作が利用される。 指定する手続きは行番号を唯一の引数として呼び出される。

stdout -> object

トレース出力先を参照します。

stdout=(fp)

トレース出力先を変更します。

stdout_mutex -> Mutex
verbose -> bool
verbose? -> bool

真ならばトレース出力の開始や終了を知らせます。

verbose=(flag)

トレース出力の開始や終了を知らせる文字列("Trace on"または"Trace off")が必要なら真を設定します。

インスタンスメソッド

定義 説明
add_filter(p = proc)

フィルターを追加します。

get_line(file, line) -> String

@param file

get_thread_no -> Integer
off -> ()

トレース出力を中断します。

on -> ()
on { ... } -> ()

トレース出力を再開します。

set_get_line_procs(file, p = proc)
stdout -> IO

@see Tracer.stdout

trace_func(event, file, line, id, binding, klass, *) -> object | nil

定数

定義 説明
EVENT_SYMBOL

トレース出力のシンボルのハッシュです。 下記のような文字列があります。

Single -> Tracer

継承したメソッド

! != == === =~ __id__ __send__ _dump class clone dclone display enum_for eql? equal? extend freeze frozen? hash initialize initialize_copy inspect instance_eval instance_exec instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? marshal_dump marshal_load method method_missing methods must_be must_be_close_to must_be_empty must_be_instance_of must_be_kind_of must_be_nil must_be_same_as must_be_within_epsilon must_equal must_include must_match must_raise must_respond_to must_send must_throw nil? pretty_inspect pretty_print pretty_print_cycle pretty_print_inspect pretty_print_instance_variables private_methods protected_methods public_methods remove_instance_variable respond_to? respond_to_missing? singleton_class singleton_method_added singleton_method_removed singleton_method_undefined singleton_methods taint tainted? tap to_a to_ary to_hash to_int to_io to_proc to_regexp to_s to_str to_yaml to_yaml_properties to_yaml_style trust untaint untrust untrusted? wont_be wont_be_close_to wont_be_empty wont_be_instance_of wont_be_kind_of wont_be_nil wont_be_same_as wont_be_within_epsilon wont_equal wont_include wont_match wont_respond_to