Class: Rookout::Logger::LogRecord
- Inherits:
-
Object
- Object
- Rookout::Logger::LogRecord
- Defined in:
- lib/rookout/logger.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#formatted_message ⇒ Object
readonly
Returns the value of attribute formatted_message.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(level, message, arguments) ⇒ LogRecord
constructor
A new instance of LogRecord.
Constructor Details
#initialize(level, message, arguments) ⇒ LogRecord
Returns a new instance of LogRecord.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rookout/logger.rb', line 61 def initialize level, , arguments @level = level @time = Time.new @message = @formatted_message = @message % arguments arguments.each do |argument| if argument.is_a? Exception @formatted_message += "\n#{argument.}\n#{argument.backtrace.join "\n\t"}" end end @arguments = arguments set_caller end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
83 84 85 |
# File 'lib/rookout/logger.rb', line 83 def arguments @arguments end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
79 80 81 |
# File 'lib/rookout/logger.rb', line 79 def filename @filename end |
#formatted_message ⇒ Object (readonly)
Returns the value of attribute formatted_message.
82 83 84 |
# File 'lib/rookout/logger.rb', line 82 def @formatted_message end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
77 78 79 |
# File 'lib/rookout/logger.rb', line 77 def level @level end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
80 81 82 |
# File 'lib/rookout/logger.rb', line 80 def lineno @lineno end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
81 82 83 |
# File 'lib/rookout/logger.rb', line 81 def @message end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
78 79 80 |
# File 'lib/rookout/logger.rb', line 78 def time @time end |
Instance Method Details
#format ⇒ Object
85 86 87 88 |
# File 'lib/rookout/logger.rb', line 85 def format "#{@time} #{Process.pid}:#{Thread.current.name}-" \ "#{File.basename @filename}:#{@label}@#{lineno} - #{@level} - #{}" end |