Class: Soda::Logger::JobLogger
- Inherits:
-
Object
- Object
- Soda::Logger::JobLogger
- Includes:
- Tools
- Defined in:
- lib/soda/logger.rb
Constant Summary
Constants included from Tools
Instance Method Summary collapse
-
#initialize(logger = Soda.logger) ⇒ JobLogger
constructor
A new instance of JobLogger.
- #with(job_hash) ⇒ Object
Methods included from Tools
#deep_symbolize_keys, #now, #sqs, #tid
Constructor Details
Instance Method Details
#with(job_hash) ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/soda/logger.rb', line 53 def with(job_hash) logger.with([:worker, job_hash["klass"]], [:jid, job_hash["id"]]) do start = now logger.info("start") yield logger.info("finish (%fms)" % (now - start)) end end |