139件ヒット
[1-100件を表示]
(0.135秒)
ライブラリ
- ビルトイン (106)
- logger (22)
-
syslog
/ logger (11)
クラス
- Exception (7)
- Logger (11)
-
Logger
:: Formatter (11) - Module (11)
- Object (22)
-
Syslog
:: Logger :: Formatter (11) -
Thread
:: Backtrace :: Location (44) - TracePoint (22)
キーワード
-
absolute
_ path (11) -
base
_ label (11) - formatter (11)
- inspect (22)
-
instance
_ method (11) - method (11)
- path (11)
-
singleton
_ method (11) -
to
_ s (11)
検索結果
先頭5件
- Logger
:: Formatter # call(severity , time , progname , msg) -> String - Syslog
:: Logger :: Formatter # call(severity , time , progname , message) -> String - Exception
# full _ message(highlight: true , order: :bottom) -> String - Thread
:: Backtrace :: Location # absolute _ path -> String - Thread
:: Backtrace :: Location # base _ label -> String
-
Logger
:: Formatter # call(severity , time , progname , msg) -> String (18203.0) -
ログ情報をフォーマットして返します。
ログ情報をフォーマットして返します。
@param severity ログレベル。
@param time 時間。Time クラスのオブジェクト。
@param progname プログラム名
@param msg メッセージ。 -
Syslog
:: Logger :: Formatter # call(severity , time , progname , message) -> String (18203.0) -
引数を元にフォーマットした文字列を返します。
引数を元にフォーマットした文字列を返します。
ライブラリ内部で使用します。 -
Exception
# full _ message(highlight: true , order: :bottom) -> String (114.0) -
例外の整形された文字列を返します。
...ack \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:i... -
Thread
:: Backtrace :: Location # absolute _ path -> String (114.0) -
self が表すフレームの絶対パスを返します。
...//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Lo... -
Thread
:: Backtrace :: Location # base _ label -> String (114.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
Thread
:: Backtrace :: Location # inspect -> String (114.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `... -
Thread
:: Backtrace :: Location # to _ s -> String (114.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...フレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/f... -
TracePoint
# inspect -> String (114.0) -
self の状態を人間に読みやすい文字列にして返します。
...self の状態を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace.enable
foo 1
//}... -
Logger
# formatter -> String (108.0) -
ログを出力する際に使用するフォーマッターを取得します。
...ログを出力する際に使用するフォーマッターを取得します。
このメソッドの返り値が持つ call メソッドは 4 つの引数 (severity, time, program name, message) を受けとります。
//emlist[例][ruby]{
require 'logger'
logger = Logger.new(STDOUT)
logger.... -
TracePoint
# path -> String (108.0) -
イベントが発生したファイルのパスを返します。
...トが発生したファイルのパスを返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//}...