Class: Legion::Data::Connection::SlowQueryLogger
- Inherits:
-
Object
- Object
- Legion::Data::Connection::SlowQueryLogger
- Defined in:
- lib/legion/data/connection.rb
Overview
Wraps a tagged Legion::Logging::Logger for Sequel's logger interface. Prefixes warn-level messages with [slow-query] since Sequel uses warn for queries exceeding log_warn_duration.
Instance Attribute Summary collapse
-
#tagged ⇒ Object
readonly
Returns the value of attribute tagged.
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(tagged_logger) ⇒ SlowQueryLogger
constructor
A new instance of SlowQueryLogger.
- #warn(message) ⇒ Object
Constructor Details
#initialize(tagged_logger) ⇒ SlowQueryLogger
Returns a new instance of SlowQueryLogger.
40 41 42 |
# File 'lib/legion/data/connection.rb', line 40 def initialize(tagged_logger) @tagged = tagged_logger end |
Instance Attribute Details
#tagged ⇒ Object (readonly)
Returns the value of attribute tagged.
38 39 40 |
# File 'lib/legion/data/connection.rb', line 38 def tagged @tagged end |
Instance Method Details
#debug(message) ⇒ Object
52 53 54 |
# File 'lib/legion/data/connection.rb', line 52 def debug() @tagged.debug() end |
#error(message) ⇒ Object
56 57 58 |
# File 'lib/legion/data/connection.rb', line 56 def error() @tagged.error() end |
#info(message) ⇒ Object
48 49 50 |
# File 'lib/legion/data/connection.rb', line 48 def info() @tagged.info() end |
#warn(message) ⇒ Object
44 45 46 |
# File 'lib/legion/data/connection.rb', line 44 def warn() @tagged.warn("[slow-query] #{}") end |