Class: ProgeressLogger

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/s3streambackup.rb

Instance Method Summary collapse

Constructor Details

#initializeProgeressLogger

Returns a new instance of ProgeressLogger.



109
110
111
# File 'lib/s3streambackup.rb', line 109

def initialize
	@bytes = 0
end

Instance Method Details

#<<(bytes) ⇒ Object



120
121
122
# File 'lib/s3streambackup.rb', line 120

def <<(bytes)
	@bytes += bytes
end

#<=>(value) ⇒ Object



129
130
131
# File 'lib/s3streambackup.rb', line 129

def <=>(value)
	@bytes <=> value
end

#in_bytes_autoObject



133
134
135
# File 'lib/s3streambackup.rb', line 133

def in_bytes_auto
	@bytes.in_bytes_auto
end

#log(logger, postfix) ⇒ Object



113
114
115
116
117
118
# File 'lib/s3streambackup.rb', line 113

def log(logger, postfix)
	if logger.debug?
		was, @output_bytes = @output_bytes || '', @bytes.in_bytes_auto
		logger.debug "#{@output_bytes}#{postfix}"
	end
end

#to_sObject



124
125
126
# File 'lib/s3streambackup.rb', line 124

def to_s
	@bytes.to_s
end