Module: ALib::Logging::LoggerExt
- Defined in:
- lib/alib-0.5.1/logging.rb
Instance Attribute Summary collapse
-
#logdev ⇒ Object
readonly
–{{{.
Instance Method Summary collapse
Instance Attribute Details
#logdev ⇒ Object (readonly)
–{{{
15 16 17 |
# File 'lib/alib-0.5.1/logging.rb', line 15 def logdev @logdev end |
Instance Method Details
#<<(*args) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/alib-0.5.1/logging.rb', line 16 def << *args #--{{{ m, c = Thread.main, Thread.current args.flatten.each do |msg| if m == c super msg else eol = msg[%r/\s*$/o] msg[%r/\s*$/o] = '' super "#{ msg } (t:#{ c.object_id })#{ eol }" end end self #--}}} end |
#___mutex ⇒ Object
–}}}
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/alib-0.5.1/logging.rb', line 31 def ___mutex #--{{{ unless defined?(@___mutex) and @___mutex begin Thread.critical = true @___mutex = Sync::new unless defined?(@___mutex) and @___mutex ensure Thread.critical = false end end @___mutex #--}}} end |
#___sync(which = :EX) ⇒ Object
–}}}
44 45 46 47 48 |
# File 'lib/alib-0.5.1/logging.rb', line 44 def ___sync which = :EX #--{{{ ___mutex.synchronize(which){ yield } #--}}} end |