Class: Zold::Log::Sync

Inherits:
Object
  • Object
show all
Defined in:
lib/zold/log.rb

Overview

Synchronized

Instance Method Summary collapse

Constructor Details

#initialize(log) ⇒ Sync

Returns a new instance of Sync.



51
52
53
54
# File 'lib/zold/log.rb', line 51

def initialize(log)
  @log = log
  @mutex = Mutex.new
end

Instance Method Details

#debug(msg) ⇒ Object



56
57
58
59
60
# File 'lib/zold/log.rb', line 56

def debug(msg)
  @mutex.synchronize do
    @log.debug(msg)
  end
end

#debug?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/zold/log.rb', line 62

def debug?
  @log.debug?
end

#error(msg) ⇒ Object



76
77
78
79
80
# File 'lib/zold/log.rb', line 76

def error(msg)
  @mutex.synchronize do
    @log.error(msg)
  end
end

#info(msg) ⇒ Object



66
67
68
69
70
# File 'lib/zold/log.rb', line 66

def info(msg)
  @mutex.synchronize do
    @log.info(msg)
  end
end

#info?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/zold/log.rb', line 72

def info?
  @log.info?
end