Module: Stratus::Logging

Included in:
Generator::Builder, Generator::Scanner
Defined in:
lib/stratus/logging.rb

Instance Method Summary collapse

Instance Method Details

#error(msg) ⇒ Object



15
16
17
# File 'lib/stratus/logging.rb', line 15

def error(msg)
  puts msg
end

#fatal(msg) ⇒ Object



23
24
25
# File 'lib/stratus/logging.rb', line 23

def fatal(msg)
  puts msg
end

#growl(message, title = "Stratus Notification", type = "stratus-notify") ⇒ Object



27
28
29
30
# File 'lib/stratus/logging.rb', line 27

def growl(message, title="Stratus Notification", type="stratus-notify")
  growler.notify type, title, message
  #notify(notify_type, title, message, priority = 0, sticky = false)
end

#growlerObject



32
33
34
35
36
37
38
39
40
# File 'lib/stratus/logging.rb', line 32

def growler
  @growler ||= begin
    if defined?(Growl)
      Growl.new( "localhost", "stratus", ["stratus-notify"])
    else
      self
    end
  end
end

#info(msg, alt = nil) ⇒ Object

Use logging?



6
7
8
9
10
11
12
13
# File 'lib/stratus/logging.rb', line 6

def info(msg, alt=nil)
  if ENV['STRATUS_LOGGING'] == 'verbose'
    puts msg
  else
    print alt unless alt.nil?
    STDOUT.flush
  end
end

#notify(type = '', title = '', msg = '') ⇒ Object



19
20
21
# File 'lib/stratus/logging.rb', line 19

def notify(type='', title='', msg='')
  puts msg
end