Module: Autogui::Logging

Included in:
Application, Window
Defined in:
lib/win32/autogui/logging.rb

Overview

wrapper for Log4r gem

Instance Method Summary collapse

Instance Method Details

#loggerObject

Logging mixin allows simple logging setup to STDOUT and optionally, to one filename. Logger is a wrapper for Log4r::Logger it accepts any methods that Log4r::Logger accepts in addition to the “logfile” filename.

Examples:

simple logging to file setup


include Autogui::Logging

logger.filename = 'log/autogui.log'
logger.warn "warning message goes to 'log/autogui.log'" 

logger.level = Log4r::DEBUG
logger.debug "this message goes to 'log/autogui.log'"


51
52
53
54
# File 'lib/win32/autogui/logging.rb', line 51

def logger
  init_logger if Log4r::Logger[STANDARD_LOGGER].nil?
  Log4r::Logger[STANDARD_LOGGER]
end