Method: ETL.logger_root
- Defined in:
- lib/etl/etl.rb
.logger_root ⇒ Object
First tries to get the cached @@logger_root Second, sets the global @@logger_root unless it is cached. Sets it to the best possible place to locate the logs: 1) where log will be from RAILS_ROOT/vendor/gems/etl 2) where log will be in a Rails model 3) where log will be in a Rails lib 4) in the local directory where ETL is being subclassed Third, uses the subclasses stored logger_root, ignoring all the rest if this is found.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/etl/etl.rb', line 77 def logger_root @@logger_root ||= case when File.exist?(File.dirname(__FILE__) + "/../../../../../log") File.(File.dirname(__FILE__) + "/../../../../../log") when File.exist?(File.dirname(__FILE__) + "/../../log") File.(File.dirname(__FILE__) + '/../../log') when File.exist?(File.dirname(__FILE__) + "/../log") File.(File.dirname(__FILE__) + '/../log') when File.exist?(File.dirname(__FILE__) + "/log") File.(File.dirname(__FILE__) + '/log') else File.(File.dirname(__FILE__)) end logger_root = read_inheritable_attribute(:logger_root) || @@logger_root end |