Class: Alfred::LogUI

Inherits:
Logger
  • Object
show all
Defined in:
lib/alfred/ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#logdevObject (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_fileObject



23
24
25
# File 'lib/alfred/ui.rb', line 23

def log_file
  @log_file ||= File.expand_path("~/Library/Logs/Alfred-Workflow.log")
end