extended_logger 0.5.1 → 0.5.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: 4ea967448298e4caf36e0036c83a2d606a35757c
4
- data.tar.gz: 1caa3d85c6624837c7c49cd105e41047b61dce9d
3
+ metadata.gz: 375150a4e2c1c8d8e3b23f85ba5d85d7e9380c7a
4
+ data.tar.gz: 2595ad3267a0c4eb828bf89e040a64a476ab402a
5
5
  SHA512:
6
- metadata.gz: 519954f3a6dbce08346df7935a3eb73e3d0fe3e79391c1592a146f488997596b9f88cfa8337a8cbf8f668fc2469b4825f71735b66ad3ea8b40e12cb00ab0af38
7
- data.tar.gz: f27967c4fcbeb77342a9c7eb06918d2b541f357df6d3554bc925f83ca6414ee0b6481b22c69ab32e390b771a61b21e2d06d0989d36423bdf8f298b1e48d97c69
6
+ metadata.gz: 7b685fcf5454fce6d6bc1f3fb0967ca27f122fabcca2f1f7d31da421401e32d48d77c1140141d6584bbbb7fe27a2bc6595397d2cfbb4ab6a79f633eebb6fc8bc
7
+ data.tar.gz: 3c04f2cfd6fca9e335b3ef50de482c125e41e32cfbdb86513367d05e7af4012fb66daf4658ff20ddd52370cb57e0d3fbf4db372214a4d35072712d50be0e8030
@@ -28,6 +28,8 @@ class ExtendedLogger
28
28
  end
29
29
 
30
30
  def colorize severity, text
31
+ text = text.dup
32
+
31
33
  fg, bg = map[severity]
32
34
 
33
35
  if bg
@@ -54,8 +56,7 @@ class ExtendedLogger
54
56
  end
55
57
 
56
58
  def dump
57
- output = ''
58
- output.force_encoding 'US-ASCII'
59
+ output = ''.encode 'US-ASCII'
59
60
 
60
61
  map.each do |level, (fg, bg)|
61
62
  fg_code = color_code fg
@@ -24,6 +24,9 @@ class ExtendedLogger
24
24
  end
25
25
 
26
26
  def format formatter, *arguments, message
27
+ message = message.to_s
28
+ message = message.dup if message.frozen?
29
+
27
30
  if BlankLine.match message.to_s
28
31
  formatter.(*arguments, '(empty log message)'.freeze)
29
32
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extended_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'An extended logger that provides a (mostly) substitutable alternative
14
14
  to ruby''s built in +Logger+ class. A number of useful extensions are provided,