barking_iguana-logging 0.1.4 → 0.1.5

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: 09b65d94ce622f1e77497bfc1341a70ab267c3b3
4
- data.tar.gz: 01eeec8e10fba14ca87ac7ef66c9da547e6a102d
3
+ metadata.gz: 3f924059c5aba5099341914b51594171e203bd99
4
+ data.tar.gz: 9aff965bda2d19f8e4f714cae98363992ef0ea7a
5
5
  SHA512:
6
- metadata.gz: 9001ed338424718b70e2fdcac31d9d6ea795ab48abdb1abb478c7b1a527677092694966e9c7e9b6b5754a431430723d408eb5dbbf918464cc07caf43a51c617f
7
- data.tar.gz: cbca774edb1580ce80f34a22ec9aad9fe7b73053c8796bb2ca54763db3ad46f360da25204b0915e81e7e1e0e17974fe8a95501fd7518ba4f6d7406a3213b5507
6
+ metadata.gz: d610cc6f77040a2b271f79f5aaa4537344af3fa0433845fcdf55b1356f08ce9e7a469843c0a84c404f266b31af047579dea0abda1f3df58ba725e14ee510fe44
7
+ data.tar.gz: e91707e1fe5b240bf34e8e1cbc7bf9161815eacbea057f5fd91c8188436c9e00e984ef2caec5437255585e9e74063aa67c303c958e608b0abd570131f4821147
data/example/example.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'barking_iguana/logging'
2
2
 
3
- BarkingIguana::Logging.colours = %w(red blue green yellow)
4
3
  class Example
5
4
  include BarkingIguana::Logging::Helper
6
5
 
@@ -9,15 +8,8 @@ class Example
9
8
  end
10
9
 
11
10
  def run
12
- logger.info message
13
- end
14
-
15
- def message
16
- (1..rand(25)).to_a.map { word }.join ' '
17
- end
18
-
19
- def word
20
- ('a'..'z').sort_by { rand }[0,1 + rand(10)].join
11
+ @i += 1
12
+ logger.info { "Testing #{@i.to_s.rjust(3, '0')}" }
21
13
  end
22
14
  end
23
15
 
@@ -1,5 +1,5 @@
1
1
  module BarkingIguana
2
2
  module Logging
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
@@ -10,9 +10,7 @@ module BarkingIguana
10
10
  include Otk::Defaults
11
11
  defaults default_level: Logger::INFO,
12
12
  default_target: Output.new($stdout),
13
- default_raw_append_threshold: Logger::DEBUG,
14
- colours: %i(red green yellow blue magenta cyan white)
15
-
13
+ default_raw_append_threshold: Logger::DEBUG
16
14
 
17
15
  def self.get_logger for_instance
18
16
  Logger.new(default_target).tap do |l|
@@ -21,6 +19,10 @@ module BarkingIguana
21
19
  end
22
20
  end
23
21
 
22
+ def self.colours
23
+ %i(red green yellow blue magenta cyan white)
24
+ end
25
+
24
26
  def self.default_formatter for_instance
25
27
  name = for_instance.class.name
26
28
  id = for_instance.object_id
@@ -29,7 +31,7 @@ module BarkingIguana
29
31
  @logger_index += 1
30
32
  colour = colours[@logger_index % colours.size]
31
33
  lambda do |severity, datetime, _progname, message|
32
- Term::ANSIColor.public_send colour, "#{datetime.iso8601} #{label} #{severity.ljust(5)} #{message}\n"
34
+ Term::ANSIColor.public_send colour, "#{datetime.iso8601(6)} #{label} #{severity.ljust(5)} #{message}\n"
33
35
  end
34
36
  end
35
37
  class << self; private :default_formatter; end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barking_iguana-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig R Webster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-10 00:00:00.000000000 Z
11
+ date: 2016-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.12'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: barking_iguana-otk
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: term-ansicolor
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description:
@@ -87,9 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".gitignore"
91
- - ".rspec"
92
- - ".travis.yml"
90
+ - .gitignore
91
+ - .rspec
92
+ - .travis.yml
93
93
  - CODE_OF_CONDUCT.md
94
94
  - Gemfile
95
95
  - LICENSE.txt
@@ -115,17 +115,17 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">="
118
+ - - '>='
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.4.5.1
128
+ rubygems_version: 2.0.14.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Helpers for my logging conventions