Class: Alfred::LogUI
- Inherits:
-
Logger
- Object
- Logger
- Alfred::LogUI
- Defined in:
- lib/alfred/ui.rb
Instance Attribute Summary collapse
-
#logdev ⇒ Object
readonly
Returns the value of attribute logdev.
Instance Method Summary collapse
-
#initialize(id, to_file = nil) ⇒ LogUI
constructor
A new instance of LogUI.
- #log_file ⇒ Object
Constructor Details
#initialize(id, to_file = nil) ⇒ LogUI
Returns a new instance of LogUI.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/alfred/ui.rb', line 10 def initialize(id, to_file=nil) if to_file @log_file = to_file log_dir = File.dirname(log_file) FileUtils.mkdir_p log_dir unless File.exists? log_dir end super log_file, 'weekly' @progname = id @default_formatter.datetime_format = '%Y-%m-%d %H:%M:%S ' end |
Instance Attribute Details
#logdev ⇒ Object (readonly)
Returns the value of attribute logdev.
8 9 10 |
# File 'lib/alfred/ui.rb', line 8 def logdev @logdev end |
Instance Method Details
#log_file ⇒ Object
23 24 25 |
# File 'lib/alfred/ui.rb', line 23 def log_file @log_file ||= File.("~/Library/Logs/Alfred-Workflow.log") end |