Module: Kryten::Lawger
- Included in:
- Task
- Defined in:
- lib/kryten/lawger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #default_log_format ⇒ Object
- #log(level = :debug, message) ⇒ Object
- #log_path ⇒ Object
- #name ⇒ Object
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/kryten/lawger.rb', line 4 def logger @logger end |
Instance Method Details
#default_log_format ⇒ Object
27 28 29 |
# File 'lib/kryten/lawger.rb', line 27 def default_log_format nil end |
#log(level = :debug, message) ⇒ Object
14 15 16 17 |
# File 'lib/kryten/lawger.rb', line 14 def log(level = :debug, ) logger.progname = name logger.send(level, ) end |
#log_path ⇒ Object
10 11 12 |
# File 'lib/kryten/lawger.rb', line 10 def log_path "log/#{name}.log" end |
#name ⇒ Object
6 7 8 |
# File 'lib/kryten/lawger.rb', line 6 def name @name || self.class.to_s.gsub('::','-').downcase end |