SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # FYI: The default logger is set at the bottom of this file.
  2.  
  3. require 'logger'
  4.  
  5. module <Project>
  6.   # The Logger instance used by <Project>. Set your own custom logger after
  7.   # requiring this file if needed.
  8.   @logger = nil
  9.  
  10.   # Returns the current Logger instance.
  11.   # @return [Logger] The current Logger instance.
  12.   def self.logger
  13.     @logger
  14.   end
  15.  
  16.   # Sets the current Logger instance.
  17.   # @param logger [Logger] The Logger instance to use.
  18.   # @return [Logger] The current Logger instance having being set.
  19.   def self.logger=(logger)
  20.     @logger = logger
  21.   end
  22.  
  23.   # Returns the default Logger instance.
  24.   # @return [Logger] The default Logger instance.
  25.   def self.default_logger
  26.     Logger.new(STDOUT, progname: '<Project>', level: :info)
  27.   end
  28.  
  29.   # Sets the default Logger instance to be used by <Project>.
  30.   # @return [Logger] The default Logger instance.
  31.   def self.use_default_logger
  32.     @logger = self.default_logger
  33.   end
  34. end
  35.  
  36. <Project>.use_default_logger
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top