Module: Tailor::Logger::Mixin
- Included in:
- Configuration, Configuration::FileSet, Critic, Tailor::Lexer::Token, Ruler, Rulers::IndentationSpacesRuler::IndentationManager
- Defined in:
- lib/tailor/logger.rb
Overview
Provides an .included hook to insert the name of the class for each log message in the class that includes the Mixin.
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/tailor/logger.rb', line 23 def self.included(base) define_method :log do |*args| class_minus_main_name = self.class.to_s.sub(/^.*::/, '') args.first.insert(0, "<#{class_minus_main_name}> ") Tailor::Logger.log(*args) end end |