batlog 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,37 +1,37 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- batlog (0.9.1)
4
+ batlog (0.9.3)
5
5
  rails
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- actionmailer (3.2.8)
11
- actionpack (= 3.2.8)
10
+ actionmailer (3.2.12)
11
+ actionpack (= 3.2.12)
12
12
  mail (~> 2.4.4)
13
- actionpack (3.2.8)
14
- activemodel (= 3.2.8)
15
- activesupport (= 3.2.8)
13
+ actionpack (3.2.12)
14
+ activemodel (= 3.2.12)
15
+ activesupport (= 3.2.12)
16
16
  builder (~> 3.0.0)
17
17
  erubis (~> 2.7.0)
18
18
  journey (~> 1.0.4)
19
- rack (~> 1.4.0)
19
+ rack (~> 1.4.5)
20
20
  rack-cache (~> 1.2)
21
21
  rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.3)
23
- activemodel (3.2.8)
24
- activesupport (= 3.2.8)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.12)
24
+ activesupport (= 3.2.12)
25
25
  builder (~> 3.0.0)
26
- activerecord (3.2.8)
27
- activemodel (= 3.2.8)
28
- activesupport (= 3.2.8)
26
+ activerecord (3.2.12)
27
+ activemodel (= 3.2.12)
28
+ activesupport (= 3.2.12)
29
29
  arel (~> 3.0.2)
30
30
  tzinfo (~> 0.3.29)
31
- activeresource (3.2.8)
32
- activemodel (= 3.2.8)
33
- activesupport (= 3.2.8)
34
- activesupport (3.2.8)
31
+ activeresource (3.2.12)
32
+ activemodel (= 3.2.12)
33
+ activesupport (= 3.2.12)
34
+ activesupport (3.2.12)
35
35
  i18n (~> 0.6)
36
36
  multi_json (~> 1.0)
37
37
  arel (3.0.2)
@@ -41,38 +41,38 @@ GEM
41
41
  hike (1.2.1)
42
42
  i18n (0.6.1)
43
43
  journey (1.0.4)
44
- json (1.7.5)
44
+ json (1.7.7)
45
45
  mail (2.4.4)
46
46
  i18n (>= 0.4.0)
47
47
  mime-types (~> 1.16)
48
48
  treetop (~> 1.4.8)
49
- mime-types (1.19)
50
- multi_json (1.3.6)
49
+ mime-types (1.21)
50
+ multi_json (1.6.0)
51
51
  polyglot (0.3.3)
52
- rack (1.4.1)
52
+ rack (1.4.5)
53
53
  rack-cache (1.2)
54
54
  rack (>= 0.4)
55
- rack-ssl (1.3.2)
55
+ rack-ssl (1.3.3)
56
56
  rack
57
57
  rack-test (0.6.2)
58
58
  rack (>= 1.0)
59
- rails (3.2.8)
60
- actionmailer (= 3.2.8)
61
- actionpack (= 3.2.8)
62
- activerecord (= 3.2.8)
63
- activeresource (= 3.2.8)
64
- activesupport (= 3.2.8)
59
+ rails (3.2.12)
60
+ actionmailer (= 3.2.12)
61
+ actionpack (= 3.2.12)
62
+ activerecord (= 3.2.12)
63
+ activeresource (= 3.2.12)
64
+ activesupport (= 3.2.12)
65
65
  bundler (~> 1.0)
66
- railties (= 3.2.8)
67
- railties (3.2.8)
68
- actionpack (= 3.2.8)
69
- activesupport (= 3.2.8)
66
+ railties (= 3.2.12)
67
+ railties (3.2.12)
68
+ actionpack (= 3.2.12)
69
+ activesupport (= 3.2.12)
70
70
  rack-ssl (~> 1.3.2)
71
71
  rake (>= 0.8.7)
72
72
  rdoc (~> 3.4)
73
73
  thor (>= 0.14.6, < 2.0)
74
74
  rake (0.9.2.2)
75
- rdoc (3.12)
75
+ rdoc (3.12.1)
76
76
  json (~> 1.4)
77
77
  rspec (2.11.0)
78
78
  rspec-core (~> 2.11.0)
@@ -82,16 +82,17 @@ GEM
82
82
  rspec-expectations (2.11.3)
83
83
  diff-lcs (~> 1.1.3)
84
84
  rspec-mocks (2.11.3)
85
- sprockets (2.1.3)
85
+ sprockets (2.2.2)
86
86
  hike (~> 1.2)
87
+ multi_json (~> 1.0)
87
88
  rack (~> 1.0)
88
89
  tilt (~> 1.1, != 1.3.0)
89
- thor (0.16.0)
90
+ thor (0.17.0)
90
91
  tilt (1.3.3)
91
- treetop (1.4.11)
92
+ treetop (1.4.12)
92
93
  polyglot
93
94
  polyglot (>= 0.3.1)
94
- tzinfo (0.3.33)
95
+ tzinfo (0.3.35)
95
96
 
96
97
  PLATFORMS
97
98
  ruby
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # BatLog v0.9.1 [![Build Status](https://secure.travis-ci.org/TheGiftsProject/batlog.png)](http://travis-ci.org/TheGiftsProject/batlog)
1
+ # BatLog v0.9.3 [![Build Status](https://secure.travis-ci.org/TheGiftsProject/batlog.png)](http://travis-ci.org/TheGiftsProject/batlog) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/TheGiftsProject/batlog)
2
2
  ![batlog-logo](https://dl.dropbox.com/u/7525692/batlog-withtext.png "BatLog")
3
3
 
4
4
  ## Setup
@@ -7,8 +7,8 @@ To install BatLog into your Rails app just the gem to your Gemfile
7
7
  gem 'batlog'
8
8
  ```
9
9
  After that run `rails generate db_log` to create the db_log's table migration.
10
- By default BatLog writes to three places - the database, the rails logger and exceptions to exceptional
11
- You can overide this behaivour by providing your own loggers or changing the default logger in the configuration.
10
+ By default BatLog writes to three places - the database, the rails logger and exceptions to exceptional.
11
+ You can overide this behavior by providing your own loggers or changing the default logger in the configuration.
12
12
 
13
13
  The cool thing about BatLog is that it adds the concept of `context` - your logs aren't one time message left by a deity but
14
14
  are part of a flow of a user in specific system and circumstance. BatLog lets you collect a context for the current Thread
@@ -113,4 +113,4 @@ require 'log/controller_support'
113
113
 
114
114
  include Log::ControllerSupport
115
115
  ```
116
- This does two things, first it adds a before_filter that captures as much data as it can into the log.context and also hooks for when a CSRF exception occurs
116
+ This does two things, first it adds a before_filter that captures as much data as it can into the log.context and also hooks for when a CSRF exception occurs
@@ -27,6 +27,11 @@ module Log
27
27
  loggers << ExceptionalLogger
28
28
  end
29
29
 
30
+ if defined?(Honeybadger)
31
+ require 'loggers/honeybadger_logger'
32
+ # we don't add it to loggers since the default is still exceptional
33
+ end
34
+
30
35
  loggers
31
36
 
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module Log
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
@@ -0,0 +1,25 @@
1
+ class HoneybadgerLogger
2
+
3
+ def self.log(severity, message, context, events, metadata)
4
+ context = context.merge(:severity => severity.to_s, :events => events, :metadata => metadata)
5
+ if message.kind_of?(Exception)
6
+ send_to_honeybadger(message, context)
7
+ elsif Log::SEVERITIES[severity] >= Log::SEVERITIES[:error]
8
+ send_to_honeybadger(Exception.new(message), context)
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def self.send_to_honeybadger(exception, context)
15
+ cloned_context = context.clone # we clone the context since we don't want to change it for the next dispatchers
16
+ notify_data = {
17
+ :url => cloned_context[:url],
18
+ :parameters => cloned_context.delete(:params),
19
+ :session_data => cloned_context.delete(:session),
20
+ :context => cloned_context
21
+ }
22
+ Honeybadger.notify(exception, notify_data)
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batlog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 2
10
- version: 0.9.2
9
+ - 3
10
+ version: 0.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Asaf Gartner
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-22 00:00:00 Z
19
+ date: 2013-02-14 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -92,6 +92,7 @@ files:
92
92
  - lib/log/version.rb
93
93
  - lib/loggers/database_logger.rb
94
94
  - lib/loggers/exceptional_logger.rb
95
+ - lib/loggers/honeybadger_logger.rb
95
96
  - lib/loggers/rails_logger.rb
96
97
  - spec/lib/dispatcher_spec.rb
97
98
  - spec/lib/events_spec.rb
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  requirements: []
129
130
 
130
131
  rubyforge_project:
131
- rubygems_version: 1.8.10
132
+ rubygems_version: 1.8.24
132
133
  signing_key:
133
134
  specification_version: 3
134
135
  summary: A structured logging system