Class: TarvitHelpers::LogQuiet

Inherits:
ConditionalLogger show all
Defined in:
lib/tarvit-helpers/modules/conditional_logger.rb

Class Method Summary collapse

Methods inherited from ConditionalLogger

#initialize, #log, #print, #puts

Constructor Details

This class inherits a constructor from TarvitHelpers::ConditionalLogger

Class Method Details

.apply(context, env_var) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/tarvit-helpers/modules/conditional_logger.rb', line 25

def self.apply(context, env_var)
  var_set = !!ENV[env_var]

  unless var_set
    context.instance_eval do
      def puts(*message); end
      def print(*message);end
    end
  end
end