Class: DNSOMatic::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsomatic/logger.rb

Overview

A simple class to provide consistent logging throughout the various other classes. All methods are class methods, so no instance is required.

Constant Summary collapse

@@opts =
Opts.instance

Class Method Summary collapse

Class Method Details

.alert(msg) ⇒ Object

Output a message to stdout if either verbose or alert was specified.



18
19
20
# File 'lib/dnsomatic/logger.rb', line 18

def self.alert(msg)
  $stdout.puts msg if @@opts.verbose or @@opts.alert
end

.log(msg) ⇒ Object

Output a message to stdout if the user specified the verbose command line option.



8
9
10
# File 'lib/dnsomatic/logger.rb', line 8

def self.log(msg)
  $stdout.puts msg if @@opts.verbose
end

.warn(msg) ⇒ Object

Output a message to regardless of verbose command line option.



13
14
15
# File 'lib/dnsomatic/logger.rb', line 13

def self.warn(msg)
  $stdout.puts msg
end