Module: Autogui::Logging

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

Overview

wrapper for Log4r gem

Constant Summary collapse

DEBUG =

Redefine logging levels so that they can be accessed before the logger is initialized at the expense of flexibility.

1
INFO =
2
WARN =
3
ERROR =
4
FATAL =
5
STANDARD_LOGGER =
'standard'

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 = Autogui::Logging::DEBUG
logger.debug "this message goes to 'log/autogui.log'"


76
77
78
79
# File 'lib/win32/autogui/logging.rb', line 76

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