Class: QueryTrack::Notifications::Log
- Inherits:
-
Object
- Object
- QueryTrack::Notifications::Log
- Defined in:
- lib/query_track/notifications/log.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(code, duration) ⇒ Log
constructor
A new instance of Log.
Constructor Details
#initialize(code, duration) ⇒ Log
Returns a new instance of Log.
6 7 8 9 |
# File 'lib/query_track/notifications/log.rb', line 6 def initialize(code, duration) @code = code.strip @duration = duration end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/query_track/notifications/log.rb', line 4 def code @code end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
4 5 6 |
# File 'lib/query_track/notifications/log.rb', line 4 def duration @duration end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/query_track/notifications/log.rb', line 11 def call return unless QueryTrack::Settings.config.logs trace = QueryTrack::Trace.new(caller).call QueryTrack.logger.info "\n#{code}\nDuration: #{duration}s\nTrace: #{trace}" end |