Class: Log4r::Logger
- Inherits:
-
Object
- Object
- Log4r::Logger
- Defined in:
- lib/win32/autogui/logging.rb
Instance Method Summary collapse
-
#logfile ⇒ String
Filename of the logfile.
- #logfile=(fn) ⇒ Object
-
#trunc ⇒ Boolean
Truncate logfile.
- #trunc=(value) ⇒ Object
Instance Method Details
#logfile ⇒ String
Returns filename of the logfile.
27 28 29 |
# File 'lib/win32/autogui/logging.rb', line 27 def logfile @filename end |
#logfile=(fn) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/win32/autogui/logging.rb', line 31 def logfile=(fn) fn = nil if fn == '' if fn == nil remove(:logfile) if @filename else FileOutputter.new(:logfile, :filename => fn, :trunc => @trunc) Outputter[:logfile].formatter = Log4r::PatternFormatter.new(:pattern => "[%5l %d] %M [%t]") add(:logfile) end @filename = fn end |
#trunc ⇒ Boolean
Returns truncate logfile.
17 18 19 |
# File 'lib/win32/autogui/logging.rb', line 17 def trunc @trunc.nil? ? true : @trunc end |
#trunc=(value) ⇒ Object
21 22 23 24 |
# File 'lib/win32/autogui/logging.rb', line 21 def trunc=(value) raise "Setting trunc has no effect since logfile is already initialized" if @filename @trunc = value end |