Class: MagicCloud::Debug

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/magic_cloud/debug.rb

Overview

Debugging utilities class for cloud development itself

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDebug

Returns a new instance of Debug.



18
19
20
21
# File 'lib/magic_cloud/debug.rb', line 18

def initialize
  @logger = Logger.new($stdout).tap { |l| l.level = Logger::FATAL }
  @stats = Hash.new { |h, k| h[k] = 0 }
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



23
24
25
# File 'lib/magic_cloud/debug.rb', line 23

def logger
  @logger
end

#statsObject (readonly)

Returns the value of attribute stats.



23
24
25
# File 'lib/magic_cloud/debug.rb', line 23

def stats
  @stats
end

Class Method Details

.instanceObject



10
11
12
# File 'lib/magic_cloud/debug.rb', line 10

def instance
  @instance ||= new
end

Instance Method Details

#reset!Object



25
26
27
# File 'lib/magic_cloud/debug.rb', line 25

def reset!
  @stats = Hash.new { |h, k| h[k] = 0 }
end