Module: SidekiqUniqueJobs::Logging
- Included in:
- Client::Middleware, Digests, SidekiqUniqueJobs::Lock::BaseLock, OnConflict::Log, OnConflict::Strategy, Server::Middleware, UniqueArgs, Util
- Defined in:
- lib/sidekiq_unique_jobs/logging.rb
Overview
Utility module for reducing the number of uses of logger.
Instance Method Summary collapse
-
#log_debug(message_or_exception = nil) { ... } ⇒ Object
Logs a message at debug level.
-
#log_error(message_or_exception = nil) { ... } ⇒ Object
Logs a message at error level.
-
#log_fatal(message_or_exception = nil) { ... } ⇒ Object
Logs a message at fatal level.
-
#log_info(message_or_exception = nil) { ... } ⇒ Object
Logs a message at info level.
-
#log_warn(message_or_exception = nil) { ... } ⇒ Object
Logs a message at warn level.
-
#logger ⇒ Object
A convenience method for using the configured logger.
- #logging_context(middleware_class, job_hash) ⇒ Object
Instance Method Details
#log_debug(message_or_exception = nil) { ... } ⇒ Object
Logs a message at debug level
17 18 19 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 17 def log_debug( = nil, &block) logger.debug(, &block) end |
#log_error(message_or_exception = nil) { ... } ⇒ Object
Logs a message at error level
41 42 43 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 41 def log_error( = nil, &block) logger.error(, &block) end |
#log_fatal(message_or_exception = nil) { ... } ⇒ Object
Logs a message at fatal level
49 50 51 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 49 def log_fatal( = nil, &block) logger.fatal(, &block) end |
#log_info(message_or_exception = nil) { ... } ⇒ Object
Logs a message at info level
25 26 27 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 25 def log_info( = nil, &block) logger.info(, &block) end |
#log_warn(message_or_exception = nil) { ... } ⇒ Object
Logs a message at warn level
33 34 35 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 33 def log_warn( = nil, &block) logger.warn(, &block) end |
#logger ⇒ Object
A convenience method for using the configured logger
9 10 11 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 9 def logger SidekiqUniqueJobs.logger end |
#logging_context(middleware_class, job_hash) ⇒ Object
53 54 55 56 |
# File 'lib/sidekiq_unique_jobs/logging.rb', line 53 def logging_context(middleware_class, job_hash) digest = job_hash['unique_digest'] "#{middleware_class} #{"DIG-#{digest}" if digest}" end |