Module: Mushin

Defined in:
lib/mushin.rb,
lib/mushin/ext.rb,
lib/mushin/stack.rb,
lib/mushin/store.rb,
lib/mushin/domain.rb,
lib/mushin/logger.rb,
lib/mushin/service.rb,
lib/mushin/version.rb,
lib/mushin/test_helper.rb

Overview

TODO release 1.0rc

Defined Under Namespace

Modules: Domain, Ext, Service, Test Classes: Logger, Stack, Store

Constant Summary collapse

VERSION =
"0.62.0"

Class Method Summary collapse

Class Method Details

.logger(shift_age: 'daily', datetime_format: '%Y-%m-%d %H:%M:%S', log_dir: 'log') ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/mushin/logger.rb', line 75

def self.logger(shift_age: 'daily',
  datetime_format: '%Y-%m-%d %H:%M:%S',
  log_dir: 'log'
 )
  #Dir.mkdir(log_dir) unless File.exists?(log_dir)
  #logger_file = "#{log_dir}/#{DateTime.now.strftime('%m_%d_%Y')}.log"
  #file = File.open(logger_file, File::APPEND | File::WRONLY | File::CREAT)
  #file.sync = true
  #file = File.open(logger_file, File::WRONLY | File::APPEND) 
  #@log = Mushin::Logger.new("| tee " + file.path, shift_age)
  @log = Mushin::Logger.new(STDOUT)
  @log.datetime_format = datetime_format
  #@log.progname = 'eventstream'
  #@log.format_message 'DEBUG', 

  @log.info "Mushin Log Levels: DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN" 
  return @log
end