dohlog 0.1.0 → 0.1.1

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.
data/lib/doh/log/event.rb CHANGED
@@ -22,8 +22,8 @@ class Event
22
22
  @time.strftime("%Y-%m-%d %H:%M:%S.") << "%03d" % (@time.usec / 1000)
23
23
  end
24
24
 
25
- def exception_name
26
- if @exception then @exception.class.to_s else '' end
25
+ def exception_text
26
+ if @exception then "#{@exception.class} => #{@exception.message}" else '' end
27
27
  end
28
28
 
29
29
  def call_stack
@@ -0,0 +1,17 @@
1
+ module DohLog
2
+
3
+ class MultiAcceptor
4
+ def initialize(*acceptors)
5
+ @acceptors = acceptors
6
+ end
7
+
8
+ def add(event)
9
+ @acceptors.each { |obj| obj.add(event) }
10
+ end
11
+
12
+ def shutdown
13
+ @acceptors.each { |obj| obj.shutdown }
14
+ end
15
+ end
16
+
17
+ end
@@ -11,8 +11,9 @@ class StreamAcceptor
11
11
  def add(event)
12
12
  @ios.puts(event.summary)
13
13
  if event.severity >= DohLog::ERROR
14
- @ios.puts("=> exception: #{event.exception_name}")
15
- @ios.puts("=> stack: #{event.call_stack}")
14
+ @ios.puts("=> exception: #{event.exception_text}")
15
+ @ios.puts("=> stack:")
16
+ event.call_stack.each { |elem| @ios.puts("=> #{elem}") }
16
17
  end
17
18
  @ios.fsync if @flush
18
19
  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.0
4
+ version: 0.1.1
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-02-07 00:00:00.000000000Z
13
+ date: 2012-03-14 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dohutil
17
- requirement: &70197583966520 !ruby/object:Gem::Requirement
17
+ requirement: &70341440987160 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.1.0
22
+ version: 0.1.7
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70197583966520
25
+ version_requirements: *70341440987160
26
26
  description: Logging framework built to be fast and flexible by leveraging the power
27
27
  of zeromq.
28
28
  email:
@@ -35,6 +35,7 @@ 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/multi_acceptor.rb
38
39
  - lib/doh/log/severity.rb
39
40
  - lib/doh/log/stream_acceptor.rb
40
41
  - lib/doh/log.rb
@@ -60,8 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
61
  version: '0'
61
62
  requirements: []
62
63
  rubyforge_project:
63
- rubygems_version: 1.8.10
64
+ rubygems_version: 1.8.15
64
65
  signing_key:
65
66
  specification_version: 3
66
67
  summary: zeromq powered logging framework
67
68
  test_files: []
69
+ has_rdoc: