semantic_logger 2.9.1 → 2.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16021fcc1001bf8f9a7805c0e041856ac2a8e7d4
4
- data.tar.gz: c5cc838698726569a32679031348e8d6e970d0df
3
+ metadata.gz: e5232fd817e451f29ef0c545ec0544773b8dafb3
4
+ data.tar.gz: 7b6126eb0d3dc720dc9471c750f01c0c5902271d
5
5
  SHA512:
6
- metadata.gz: 55d8f67c85aa0d40e31d566b63a2baffd5aadaff647c147f9856154c64d2fb8e34f2a690de923c1238175b41ae85a8f6c366fb33c69b2dd8e4690c3909f20b0e
7
- data.tar.gz: bcf75d343fec7bf5c0f13b1260ed735ef0cedbea19bf6530010c91e8ca3744dc3698d90f5214e0b7359e6a7f7248accfded5a9a3d38cfae572c504d5c4102a0e
6
+ metadata.gz: 15d25abc264cde1238938cc805263b63df7b7547cc1632a653b6ea45f77addbe71cbb884e54317b9baa27a6107ab30145ef8d8471f1fe785818fd00568746319
7
+ data.tar.gz: c62818a647641c2280839e253d165b77a9643bdecdacbf0745b882c7151e81e6ea5ec382f9c650bd3e75a77a2b499d3293af63a70c132b4ca079b038de4d33a9
@@ -206,7 +206,9 @@ module SemanticLogger
206
206
 
207
207
  case @protocol
208
208
  when :syslog
209
- ::Syslog.log @level_map[log.level], formatter.call(log)
209
+ # Since the Ruby Syslog API supports sprintf format strings, double up all existing '%'
210
+ message = formatter.call(log).gsub "%", "%%"
211
+ ::Syslog.log @level_map[log.level], message
210
212
  when :tcp
211
213
  @remote_syslog.retry_on_connection_failure { @remote_syslog.write("#{syslog_packet_formatter(log)}\r\n") }
212
214
  when :udp
@@ -247,7 +249,6 @@ module SemanticLogger
247
249
  packet.content = default_formatter.call(log)
248
250
  packet.to_s
249
251
  end
250
-
251
252
  end
252
253
  end
253
- end
254
+ end
@@ -113,10 +113,10 @@ module SemanticLogger
113
113
  # Returns nil if no tags are currently set
114
114
  # To support: ActiveSupport::TaggedLogging V3 and above
115
115
  def tagged(*tags)
116
- push_tags(*tags)
117
- yield
116
+ new_tags = push_tags(*tags)
117
+ yield self
118
118
  ensure
119
- pop_tags(tags.size)
119
+ pop_tags(new_tags.size)
120
120
  end
121
121
 
122
122
  # Previous method for supplying tags
@@ -131,11 +131,13 @@ module SemanticLogger
131
131
  end
132
132
 
133
133
  # Add tags to the current scope
134
+ # Returns the list of tags pushed after flattening them out and removing blanks
134
135
  def push_tags *tags
135
136
  # Need to flatten and reject empties to support calls from Rails 4
136
137
  new_tags = tags.flatten.collect(&:to_s).reject(&:empty?)
137
138
  t = Thread.current[:semantic_logger_tags]
138
139
  Thread.current[:semantic_logger_tags] = t.nil? ? new_tags : t.concat(new_tags)
140
+ new_tags
139
141
  end
140
142
 
141
143
  # Remove specified number of tags from the current tag list
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger #:nodoc
2
- VERSION = "2.9.1"
2
+ VERSION = "2.9.2"
3
3
  end
@@ -46,5 +46,14 @@ class AppenderSyslogTest < Test::Unit::TestCase
46
46
  end
47
47
  end
48
48
 
49
+ should "allow logging with %" do
50
+ message = "AppenderSyslogTest %test"
51
+ syslog_appender = SemanticLogger::Appender::Syslog.new
52
+
53
+ assert_nothing_raised ArgumentError do
54
+ syslog_appender.debug(message)
55
+ end
56
+ end
57
+
49
58
  end
50
- end
59
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 2.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-07 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sync_attr