dohlog 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- require 'doh/log/interface'
2
-
3
1
  class Module
2
+ undef dohlog
4
3
  def dohlog
5
4
  @dohlog ||= DohLog::Interface.new(self.to_s)
6
5
  end
7
6
  end
8
7
 
9
8
  class Object
9
+ undef dohlog
10
10
  def dohlog
11
11
  self.class.dohlog
12
12
  end
@@ -38,12 +38,4 @@ class Interface
38
38
  end
39
39
  end
40
40
 
41
- def self.setup(acceptor)
42
- DohLog::Interface.setup(acceptor)
43
- end
44
-
45
- def self.shutdown
46
- DohLog::Interface.shutdown
47
- end
48
-
49
41
  end
@@ -0,0 +1,19 @@
1
+ module DohLog
2
+
3
+ class MemoryAcceptor
4
+ attr_accessor :events
5
+
6
+ def initialize
7
+ @events = []
8
+ end
9
+
10
+ def add(event)
11
+ @events << event
12
+ end
13
+
14
+ def shutdown
15
+ @events.clear
16
+ end
17
+ end
18
+
19
+ end
@@ -0,0 +1,7 @@
1
+ class Module
2
+ undef dohlog
3
+ end
4
+
5
+ class Object
6
+ undef dohlog
7
+ end
data/lib/doh/log.rb CHANGED
@@ -1,2 +1,26 @@
1
+ require 'doh/log/stub'
1
2
  require 'doh/log/interface'
2
- require 'doh/log/integrate'
3
+
4
+ module DohLog
5
+
6
+ def self.setup(acceptor)
7
+ require 'doh/log/integrate'
8
+ DohLog::Interface.setup(acceptor)
9
+ end
10
+
11
+ def self.shutdown
12
+ DohLog::Interface.shutdown
13
+ end
14
+
15
+ def self.disable
16
+ return if dohlog == StubInterface
17
+ load 'doh/log/unintegrate.rb'
18
+ load 'doh/log/stub.rb'
19
+ end
20
+
21
+ def self.enable
22
+ return unless dohlog == StubInterface
23
+ load 'doh/log/integrate.rb'
24
+ end
25
+
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,19 +10,19 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-03-14 00:00:00.000000000Z
13
+ date: 2012-04-03 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dohutil
17
- requirement: &70341440987160 !ruby/object:Gem::Requirement
17
+ requirement: &70309048582540 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.1.7
22
+ version: 0.1.9
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70341440987160
25
+ version_requirements: *70309048582540
26
26
  description: Logging framework built to be fast and flexible by leveraging the power
27
27
  of zeromq.
28
28
  email:
@@ -35,9 +35,11 @@ files:
35
35
  - lib/doh/log/event.rb
36
36
  - lib/doh/log/integrate.rb
37
37
  - lib/doh/log/interface.rb
38
+ - lib/doh/log/memory_acceptor.rb
38
39
  - lib/doh/log/multi_acceptor.rb
39
40
  - lib/doh/log/severity.rb
40
41
  - lib/doh/log/stream_acceptor.rb
42
+ - lib/doh/log/unintegrate.rb
41
43
  - lib/doh/log.rb
42
44
  - MIT-LICENSE
43
45
  homepage: https://github.com/atpsoft/dohlog