super_logger_rb 0.1.0 → 0.1.1

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: 07e29929a7683472d3c1bdfd640cd96d72a5df9d
4
- data.tar.gz: f2a7fe3a91eac4519f98b8b62eaa0b24227a12c0
3
+ metadata.gz: f70f1de7c94999f08cd0ad2a01ca9abd770bd63c
4
+ data.tar.gz: 18e0fb21106363234b651ccc111b29867c08c599
5
5
  SHA512:
6
- metadata.gz: d2c2e5bf33fb391b5a39f374f4b5466902b57d2f5115c7fbd5e1d7c210dc84d28247472af82afcac974b76953b16402c5cc2e12980c22f00760d813d4e216b49
7
- data.tar.gz: e7d11566c9904a086023a4a0f45e06e280518b4b1f491bedfdfc3280348e670affd25f33ce27532ba1984080ce2c12358717bdf37dc84406ad9333adab6528c1
6
+ metadata.gz: b10ae4616c1689465df084ff9b959375b3553a8083814bd320edb5d9f10a44221b81dee18ef9e7bfbb130a57b201991214c16c2e78b68cf7cdbe3738333fd563
7
+ data.tar.gz: 33e00e42c40bb802b10b4d150651bc0dc9fe35b665ce7293a2254941a147938d05531e431eccdc9ca6e4706176d800ade277f8ba45a13b8e7285b257f16ef350
@@ -1,3 +1,3 @@
1
1
  module SuperLogger
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/super_logger.rb CHANGED
@@ -2,40 +2,46 @@ require "super_logger/version"
2
2
  require "colorized_string"
3
3
  require "logger"
4
4
 
5
- class SuperLogger < Logger
6
- module Color
7
- def self.next
8
- color_loop.next
9
- end
5
+ module SuperLogger
6
+ def self.new(*a)
7
+ Instance.new(*a)
8
+ end
10
9
 
11
- def self.color_loop
12
- @color_loop ||= Enumerator.new do |y|
13
- loop do
14
- colors.each { |c| y << c }
10
+ class Instance < Logger
11
+ module Color
12
+ def self.next
13
+ color_loop.next
14
+ end
15
+
16
+ def self.color_loop
17
+ @color_loop ||= Enumerator.new do |y|
18
+ loop do
19
+ colors.each { |c| y << c }
20
+ end
15
21
  end
16
22
  end
17
- end
18
23
 
19
- def self.colors
20
- @colors ||= begin
21
- colors = ColorizedString.colors.shuffle
22
- colors.delete(:default)
23
- colors
24
- end
24
+ def self.colors
25
+ @colors ||= begin
26
+ colors = ColorizedString.colors.shuffle
27
+ colors.delete(:default)
28
+ colors
29
+ end
30
+ end
25
31
  end
26
- end
27
32
 
28
- def initialize(*a, prefix: nil, use_color: true)
29
- super *a
30
- @color = SuperLogger::Color.next if use_color
31
- @prefix = prefix
32
- end
33
+ def initialize(*a, prefix: nil, use_color: true)
34
+ super *a
35
+ @color = SuperLogger::Color.next if use_color
36
+ @prefix = prefix
37
+ end
33
38
 
34
- %i(debug info warn error fatal unknown).each do |sym|
35
- define_method sym do |msg|
36
- msg = "[#{@prefix}] #{msg}" if @prefix
37
- msg = ColorizedString[msg].colorize(@color) if @color
38
- super msg
39
+ %i(debug info warn error fatal unknown).each do |sym|
40
+ define_method sym do |msg|
41
+ msg = "[#{@prefix}] #{msg}" if @prefix
42
+ msg = ColorizedString[msg].colorize(@color) if @color
43
+ super msg
44
+ end
39
45
  end
40
46
  end
41
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_logger_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Bodah