logjam_agent 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDlmYzcyNGJmZTJiMzM4OWZiMzY2M2QxMDA5ZTkxMTY2NTczMjUyYw==
5
+ data.tar.gz: !binary |-
6
+ YTg4Y2NmNzdjZjNhMWI3MjZhZTQ2NGExNzExNmJiZjhhNGZhNmJjZQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZTBjNDg1NmJmYjdiZTkzMWVhZjdkOWZhYmQxZDBlM2RkNGRmYmZhZDY5Yjlm
10
+ MWRiM2Q5YTNjZWJjNGM0ZjAzMWM3Njk5YmJiYzBkNzQwMGJkNWFkZDUzNGQx
11
+ Nzg1YTU3OGE4ZTFmYTJlMGMzZDEzYTYyNmZlMzMyZGU5ZDMyODY=
12
+ data.tar.gz: !binary |-
13
+ NWY1NTE5NTMyOGI5ZTBlZGNkOWQ5ODM4MGJiYTMwMzE2YjQzNTcxZTNhMWYw
14
+ YWIxMzcyNDQ2MTlkNzg5ZTRjNmUzYzM0ZmNlYTg0MDBjYWZmNTExYzQyYjhk
15
+ MDAwYmZlYmJmYjhhMjE0MzUxYjUzODI5YmJiNWUzYjAzOTY2NjA=
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .rvmrc
@@ -3,6 +3,23 @@ require 'fileutils'
3
3
  if ActiveSupport::VERSION::STRING < "4.0"
4
4
  require 'active_support/buffered_logger'
5
5
  require 'active_support/core_ext/logger'
6
+ if ActiveSupport::VERSION::STRING < "4.0"
7
+ require 'active_support/tagged_logging'
8
+ # monkey patch to handle exceptions correctly
9
+ # not needed for rails 4 as this uses a Formatter to add the tags
10
+ class ActiveSupport::TaggedLogging
11
+ def initialize(logger)
12
+ @logger = logger
13
+ if logger.is_a?(LogjamAgent::BufferedLogger)
14
+ self.class.class_eval <<-EVAL, __FILE__, __LINE__ + 1
15
+ def add(severity, message = nil, progname = nil, &block)
16
+ @logger.add(severity, message, progname, tags_text, &block)
17
+ end
18
+ EVAL
19
+ end
20
+ end
21
+ end
22
+ end
6
23
  else
7
24
  require 'active_support/logger'
8
25
 
@@ -62,20 +79,22 @@ module LogjamAgent
62
79
  end
63
80
  end
64
81
 
65
- def add(severity, message = nil, progname = nil, &block)
82
+ def add(severity, message = nil, progname = nil, tags_text = nil, &block)
66
83
  return if level > severity
67
84
  message = progname if message.nil?
68
- progname = nil # rails 3.2 bug when using tagged logging
85
+ progname = nil
86
+ message ||= block.call || '' if block
69
87
  request = self.request || Thread.main.thread_variable_get(:logjam_request)
70
88
  if message.is_a?(Exception)
71
89
  request.add_exception(message.class.to_s) if request
72
90
  message = format_exception(message)
73
91
  else
74
- message = (message || (block && block.call) || '').to_s
92
+ message = message.to_s
75
93
  if request && severity >= Logger::ERROR && (e = detect_logged_exception(message))
76
94
  request.add_exception(e)
77
95
  end
78
96
  end
97
+ message = "#{tags_text}#{message}" unless tags_text.blank?
79
98
  time = Time.now
80
99
  formatted_message = formatter.call(severity, time, progname, message)
81
100
  if respond_to?(:buffer)
@@ -34,7 +34,7 @@ module LogjamAgent
34
34
  end
35
35
 
36
36
  if Rails.env.development?
37
- def format_host_info(proganme); ""; end
37
+ def format_host_info(progname); ""; end
38
38
  else
39
39
  def format_host_info(progname)
40
40
  " #{@hostname} #{progname||@app_name}[#{$$}]"
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,103 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
- version: !ruby/object:Gem::Version
4
- hash: 1
5
- prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.2
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Stefan Kaes
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-07-20 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rake
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ! '>='
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
32
24
  type: :development
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: i18n
36
25
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
26
+ name: rake
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ version_requirements: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
46
38
  type: :development
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: activesupport
50
39
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
40
+ name: i18n
41
+ - !ruby/object:Gem::Dependency
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
60
52
  type: :runtime
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: uuid4r
64
53
  prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
54
+ name: activesupport
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ version_requirements: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
74
66
  type: :runtime
75
- version_requirements: *id004
76
- - !ruby/object:Gem::Dependency
77
- name: time_bandits
78
67
  prerelease: false
79
- requirement: &id005 !ruby/object:Gem::Requirement
80
- none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- - 4
88
- version: "0.4"
68
+ name: uuid4r
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0.4'
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0.4'
89
80
  type: :runtime
90
- version_requirements: *id005
81
+ prerelease: false
82
+ name: time_bandits
91
83
  description: Logjam logger and request information forwarding
92
- email:
84
+ email:
93
85
  - stefan.kaes@xing.com
94
86
  executables: []
95
-
96
87
  extensions: []
97
-
98
88
  extra_rdoc_files: []
99
-
100
- files:
89
+ files:
101
90
  - .gitignore
102
91
  - Gemfile
103
92
  - README.rdoc
@@ -116,38 +105,27 @@ files:
116
105
  - lib/logjam_agent/zmq_forwarder.rb
117
106
  - logjam_agent.gemspec
118
107
  - rails/init.rb
119
- homepage: ""
108
+ homepage: ''
120
109
  licenses: []
121
-
110
+ metadata: {}
122
111
  post_install_message:
123
112
  rdoc_options: []
124
-
125
- require_paths:
113
+ require_paths:
126
114
  - lib
127
- required_ruby_version: !ruby/object:Gem::Requirement
128
- none: false
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- hash: 3
133
- segments:
134
- - 0
135
- version: "0"
136
- required_rubygems_version: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- hash: 3
142
- segments:
143
- - 0
144
- version: "0"
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
145
125
  requirements: []
146
-
147
126
  rubyforge_project: logjam_agent
148
- rubygems_version: 1.8.24
127
+ rubygems_version: 2.0.5
149
128
  signing_key:
150
- specification_version: 3
129
+ specification_version: 4
151
130
  summary: Logjam client library to be used with logjam
152
131
  test_files: []
153
-