Class: EY::Backup::Logger

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ey_backup/logger.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout = $stdout, stderr = $stderr) ⇒ Logger



20
21
22
# File 'lib/ey_backup/logger.rb', line 20

def initialize(stdout = $stdout, stderr = $stderr)
  @stdout, @stderr = stdout, stderr
end

Instance Attribute Details

#stderrObject

Returns the value of attribute stderr.



6
7
8
# File 'lib/ey_backup/logger.rb', line 6

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



6
7
8
# File 'lib/ey_backup/logger.rb', line 6

def stdout
  @stdout
end

Class Method Details

.quietObject



16
17
18
# File 'lib/ey_backup/logger.rb', line 16

def self.quiet
  new(StringIO.new)
end

Instance Method Details

#say(msg, newline = true) ⇒ Object



24
25
26
# File 'lib/ey_backup/logger.rb', line 24

def say(msg, newline = true)
  newline ? info(msg) : stdout.print(msg)
end