Class: TaggedLogger
- Inherits:
-
Logger
- Object
- Logger
- TaggedLogger
- Defined in:
- lib/tagged_objects_logger.rb
Overview
TaggedLogger class inherit from Ruby logger and override its methods
Instance Attribute Summary collapse
-
#log_path ⇒ Object
Returns the value of attribute log_path.
Class Method Summary collapse
Instance Method Summary collapse
- #debug(message = nil, *objects_list) ⇒ Object
- #error(message = nil, *objects_list) ⇒ Object
- #fatal(message = nil, *objects_list) ⇒ Object
- #info(message = nil, *objects_list) ⇒ Object
-
#initialize(*path) ⇒ TaggedLogger
constructor
A new instance of TaggedLogger.
- #unknown(message = nil, *objects_list) ⇒ Object
- #warn(message = nil, *objects_list) ⇒ Object
Constructor Details
#initialize(*path) ⇒ TaggedLogger
Returns a new instance of TaggedLogger.
12 13 14 15 |
# File 'lib/tagged_objects_logger.rb', line 12 def initialize(*path) @log_path = path.empty? ? Rails.root.join("log/#{Rails.env}.log") : path.first super(@log_path).as_json end |
Instance Attribute Details
#log_path ⇒ Object
Returns the value of attribute log_path.
6 7 8 |
# File 'lib/tagged_objects_logger.rb', line 6 def log_path @log_path end |
Class Method Details
.instance ⇒ Object
8 9 10 |
# File 'lib/tagged_objects_logger.rb', line 8 def self.instance @instance ||= TaggedLogger.new end |
Instance Method Details
#debug(message = nil, *objects_list) ⇒ Object
25 26 27 |
# File 'lib/tagged_objects_logger.rb', line 25 def debug( = nil, *objects_list) super((, objects_list)) end |
#error(message = nil, *objects_list) ⇒ Object
21 22 23 |
# File 'lib/tagged_objects_logger.rb', line 21 def error( = nil, *objects_list) super((, objects_list)) end |
#fatal(message = nil, *objects_list) ⇒ Object
33 34 35 |
# File 'lib/tagged_objects_logger.rb', line 33 def fatal( = nil, *objects_list) super((, objects_list)) end |
#info(message = nil, *objects_list) ⇒ Object
17 18 19 |
# File 'lib/tagged_objects_logger.rb', line 17 def info( = nil, *objects_list) super((, objects_list)) end |
#unknown(message = nil, *objects_list) ⇒ Object
29 30 31 |
# File 'lib/tagged_objects_logger.rb', line 29 def unknown( = nil, *objects_list) super((, objects_list)) end |
#warn(message = nil, *objects_list) ⇒ Object
37 38 39 |
# File 'lib/tagged_objects_logger.rb', line 37 def warn( = nil, *objects_list) super((, objects_list)) end |