Module: ZmLogger

Included in:
Zm::Client::ClusterConfig, Zm::Client::SoapBaseConnector
Defined in:
lib/zm/modules/zm_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



4
5
6
# File 'lib/zm/modules/zm_logger.rb', line 4

def logger
  @logger
end

#logger_file_pathObject

Returns the value of attribute logger_file_path.



4
5
6
# File 'lib/zm/modules/zm_logger.rb', line 4

def logger_file_path
  @logger_file_path
end

#logger_levelObject

Returns the value of attribute logger_level.



4
5
6
# File 'lib/zm/modules/zm_logger.rb', line 4

def logger_level
  @logger_level
end

Instance Method Details

#init_loggerObject



18
19
20
21
22
23
24
25
# File 'lib/zm/modules/zm_logger.rb', line 18

def init_logger
  logger = Logger.new(logger_file_path)
  logger.level = logger_level
  logger.formatter = proc do |severity, datetime, prog_name, msg|
    "#{datetime.strftime('%Y-%m-%d %H:%M:%S')} #{severity} #{prog_name} - #{msg}\n"
  end
  logger
end