Class: ObjectLogging::Log::Base
- Inherits:
-
Object
- Object
- ObjectLogging::Log::Base
show all
- Defined in:
- lib/object_logging/log/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(object, options) ⇒ Base
Returns a new instance of Base.
7
8
9
10
|
# File 'lib/object_logging/log/base.rb', line 7
def initialize(object, options)
@storage = []
@lock = Mutex.new
end
|
Instance Method Details
20
21
22
|
# File 'lib/object_logging/log/base.rb', line 20
def clear
@lock.synchronize{ @storage.clear }
end
|
16
17
18
|
# File 'lib/object_logging/log/base.rb', line 16
def entries
@lock.synchronize{ @storage.dup }
end
|
#log(level, context, message) ⇒ Object
12
13
14
|
# File 'lib/object_logging/log/base.rb', line 12
def log(level, context, message)
@lock.synchronize{ @storage << [level, context, message] }
end
|