legion-logging 1.1.3 → 1.1.4

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
  SHA256:
3
- metadata.gz: 2c23b52e80d98a8fe9dd57a6c035ae3a1dbf944c36df1dcb75e4a40579cc6877
4
- data.tar.gz: f033aaa8333c5b732bf8d7fea044f3b1a763f93e1e6e6f505fd96bbe5c3fa9f3
3
+ metadata.gz: 55dd24d5d41069814f94578074efb34ff836d58e6eaa57275ec7da040de84b85
4
+ data.tar.gz: d17d87bd089075b217aff583e3aba1ee8fc1e14270a6b97e2f8783590b484dd9
5
5
  SHA512:
6
- metadata.gz: b41978935615219e45cdf4df3c3c519fd2a5bcce8a56b435f6b582e6d0ae7c54ec76ca31aa1da431f705909572c1afccfd59b91979e9d934559a5ac4180a8b2a
7
- data.tar.gz: 2ab09da5cb65c19b11ea68501b96bf358ad2d3c1db6fe590460e5cdf242f63b6de0a9987a67c31e9bafbf0e6c9287f9255db273f180d12d8fb8cc7c6fb338db2
6
+ metadata.gz: 172072cc4546bc984fb1c3399290066fd0dd41cfc8099a5c744eb9e3324753560ff24e94ab1850db683efea53e7e80ce33454322c56e11a931e8b57398f21c6c
7
+ data.tar.gz: d6339b22d9a50eb9a72022c35e4679ef0efa0326ba3b6ab6b7f1b9174eb796ec122878b23056ff2d0cc7ee0e0ed4be6230bd0bb40c97e556bd2d7abd0a49cdca
@@ -1,67 +1,90 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby: circleci/ruby@0.2.1
4
- sonarcloud: sonarsource/sonarcloud@1.0.1
3
+ ruby: circleci/ruby@1.1.2
4
+ sonarcloud: sonarsource/sonarcloud@1.0.2
5
5
 
6
6
  jobs:
7
7
  "rubocop":
8
8
  docker:
9
- - image: circleci/ruby:2.7-node
9
+ - image: cimg/ruby:2.7
10
10
  steps:
11
11
  - checkout
12
- - ruby/load-cache
13
- - ruby/install-deps
14
- - run:
15
- name: Run Rubocop
16
- command: bundle exec rubocop
17
- - ruby/save-cache
12
+ - restore_cache:
13
+ key: "bundler cache mri"
14
+ - run: bundle update
15
+ - run: bundle exec rubocop --format=json --out=rubocop-result.json
16
+ - store_test_results:
17
+ path: rubocop-result.json
18
+ - sonarcloud/scan
19
+ - run: bundle exec rubocop
20
+ - save_cache:
21
+ key: "bundler cache mri"
22
+ paths:
23
+ - "/usr/local/bundle"
18
24
  "ruby-two-five":
19
25
  docker:
20
- - image: circleci/ruby:2.5
26
+ - image: cimg/ruby:2.5
21
27
  steps:
22
28
  - checkout
23
- - ruby/load-cache
24
- - run:
25
- name: update bundler
26
- command: gem update bundler
27
- - ruby/install-deps
28
- - ruby/run-tests
29
- - ruby/save-cache
29
+ - restore_cache:
30
+ key: "bundler cache mri"
31
+ - run: bundle update
32
+ - save_cache:
33
+ key: "bundler cache mri"
34
+ paths:
35
+ - "/usr/local/bundle"
36
+ - run: bundle exec rspec --format progress --format RspecJunitFormatter -o rspec-results.xml
37
+ - store_test_results:
38
+ path: rspec-results.xml
39
+ - sonarcloud/scan
30
40
  "ruby-two-six":
31
41
  docker:
32
- - image: circleci/ruby:2.6
42
+ - image: cimg/ruby:2.6
33
43
  steps:
34
44
  - checkout
35
- - ruby/load-cache
36
- - run:
37
- name: update bundler
38
- command: gem update bundler
39
- - ruby/install-deps
40
- - ruby/run-tests
41
- - ruby/save-cache
45
+ - restore_cache:
46
+ key: "bundler cache mri"
47
+ - run: bundle update
48
+ - save_cache:
49
+ key: "bundler cache mri"
50
+ paths:
51
+ - "/usr/local/bundle"
52
+ - run: bundle exec rspec --format progress --format RspecJunitFormatter -o rspec-results.xml
53
+ - store_test_results:
54
+ path: rspec-results.xml
55
+ - sonarcloud/scan
42
56
  "ruby-two-seven":
43
57
  docker:
44
58
  - image: circleci/ruby:2.7
45
- - image: memcached:1.5-alpine
46
59
  steps:
47
60
  - checkout
48
- - ruby/load-cache
49
- - ruby/install-deps
50
- - ruby/run-tests
51
- - ruby/save-cache
52
- "sonarcloud":
61
+ - restore_cache:
62
+ key: "bundler cache mri"
63
+ - run: bundle update
64
+ - save_cache:
65
+ key: "bundler cache mri"
66
+ paths:
67
+ - "/usr/local/bundle"
68
+ - run: bundle exec rspec --format progress --format RspecJunitFormatter -o rspec-results.xml
69
+ - store_test_results:
70
+ path: rspec-results.xml
71
+ - sonarcloud/scan
72
+ "ruby-three":
53
73
  docker:
54
- - image: circleci/ruby:2.7
74
+ - image: circleci/ruby:3
55
75
  steps:
56
76
  - checkout
57
- - ruby/load-cache
58
- - ruby/install-deps
59
- - ruby/run-tests
60
- - run:
61
- name: Run Rubocop
62
- command: bundle exec rubocop --format=json --out=rubocop-result.json
77
+ - restore_cache:
78
+ key: "bundler cache mri"
79
+ - run: bundle update
80
+ - save_cache:
81
+ key: "bundler cache mri"
82
+ paths:
83
+ - "/usr/local/bundle"
84
+ - run: bundle exec rspec --format progress --format RspecJunitFormatter -o rspec-results.xml
85
+ - store_test_results:
86
+ path: rspec-results.xml
63
87
  - sonarcloud/scan
64
- - ruby/save-cache
65
88
 
66
89
  workflows:
67
90
  version: 2
@@ -77,7 +100,6 @@ workflows:
77
100
  - ruby-two-seven:
78
101
  requires:
79
102
  - ruby-two-five
80
- - sonarcloud:
103
+ - ruby-three:
81
104
  requires:
82
- - ruby-two-seven
83
- - ruby-two-six
105
+ - ruby-two-five
@@ -7,14 +7,7 @@ Metrics/ClassLength:
7
7
  Metrics/BlockLength:
8
8
  Max: 75
9
9
  Metrics/CyclomaticComplexity:
10
- Max: 10
11
- Layout/SpaceAroundEqualsInParameterDefault:
12
- EnforcedStyle: space
13
- Style/SymbolArray:
14
- Enabled: true
15
- Layout/HashAlignment:
16
- EnforcedHashRocketStyle: table
17
- EnforcedColonStyle: table
10
+ Max: 9
18
11
  Style/Documentation:
19
12
  Enabled: false
20
13
  AllCops:
data/README.md CHANGED
@@ -27,15 +27,9 @@ This library is utilized by Legion to log messages
27
27
 
28
28
  This gem can be viewed and download from [RubyGems - Legion-Logging](https://rubygems.org/gems/legion-logging)
29
29
 
30
- ## Development
31
-
32
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
-
34
- To install this gem onto your local machine, run `bundle exec install`.
35
-
36
30
  ## Contributing
37
31
 
38
- Bug reports and pull requests are welcome on GitHub at https://bitbucket.org/legion-io/legion-logging/issues This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
32
+ Bug reports and pull requests are welcome on Bitbucket at https://bitbucket.org/legion-io/legion-logging/issues This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
39
33
 
40
34
  ## License
41
35
 
@@ -1,18 +1,17 @@
1
- image: ruby:2.7.0
1
+ image: ruby:2.7
2
2
 
3
3
  pipelines:
4
- branches:
5
- master:
4
+ tags:
5
+ "v*":
6
6
  - step:
7
7
  name: Push to RubyGems
8
8
  deployment: RubyGems
9
9
  script:
10
- - gem install bundler gem-release rake rspec
11
- - bundle install
12
- - rake build
13
- - mkdir .gem
14
- - (umask 077 ; echo $gem_creds | base64 --decode > .gem/credentials)
10
+ - gem install gem-release
11
+ - (umask 077 ; echo $gem_creds | base64 --decode > ~/.gem/credentials)
15
12
  - gem release
16
- - gem tag --push
17
13
  artifacts:
18
14
  - pkg/**
15
+ definitions:
16
+ caches:
17
+ bundler: /usr/local/bundle
@@ -22,16 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
23
  f.match(%r{^(test|spec|features)/})
24
24
  end
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
25
  spec.require_paths = ['lib']
27
26
 
28
- spec.add_development_dependency 'bundler'
29
27
  spec.add_development_dependency 'codecov'
30
28
  spec.add_development_dependency 'rake'
31
29
  spec.add_development_dependency 'rspec'
32
30
  spec.add_development_dependency 'rspec_junit_formatter'
33
31
  spec.add_development_dependency 'rubocop'
34
- spec.add_development_dependency 'rubocop-performance'
35
32
  spec.add_development_dependency 'simplecov', '< 0.18.0'
36
33
 
37
34
  spec.add_dependency 'rainbow', '~> 3'
@@ -14,9 +14,9 @@ module Legion
14
14
  attr_reader :color
15
15
 
16
16
  def setup(level: 'info', **options)
17
- output(options)
17
+ output(**options)
18
18
  log_level(level)
19
- log_format(options)
19
+ log_format(**options)
20
20
  @color = options[:color]
21
21
  @color = true if options[:color].nil? && options[:log_file].nil?
22
22
  end
@@ -1,29 +1,30 @@
1
1
  module Legion
2
2
  module Logging
3
3
  module Builder
4
- def log_format(options = {}) # rubocop:disable Metrics/AbcSize
4
+ def log_format(include_pid: false, **options) # rubocop:disable Metrics/AbcSize
5
5
  log.formatter = proc do |severity, datetime, _progname, msg|
6
- options[:lex_name] = options.key?(:lex) ? "[lex-#{options[:lex]}]" : nil
6
+ options[:lex_name] = options.key?(:lex) ? "[#{options[:lex]}]" : nil
7
7
  unless options[:lex_name].nil?
8
8
  data = caller_locations[4].to_s.split('/').last(2)
9
9
  runner_trace = {
10
- type: data[0],
11
- file: data[1].split('.')[0],
12
- function: data[1].split('`')[1].delete_suffix('\''),
10
+ type: data[0],
11
+ file: data[1].split('.')[0],
12
+ function: data[1].split('`')[1].delete_suffix('\''),
13
13
  line_number: data[1].split(':')[1]
14
14
  }
15
15
  end
16
- string = "[#{datetime}][#{::Process.pid}]"
16
+ string = "[#{datetime}]"
17
+ string.concat("[#{::Process.pid}]") if include_pid
17
18
  string.concat(options[:lex_name]) unless options[:lex_name].nil?
18
19
  if runner_trace.is_a?(Hash) && (options[:extended] || severity == 'debug')
19
- string.concat("[#{runner_trace[:type]}:#{runner_trace[:file]}:#{runner_trace[:line_number]}]")
20
+ string.concat("[#{runner_trace[:type]}:#{runner_trace[:file]}:#{runner_trace[:function]}:#{runner_trace[:line_number]}]") # rubocop:disable Layout/LineLength
20
21
  end
21
22
  string.concat(" #{severity} #{msg}\n")
22
23
  string
23
24
  end
24
25
  end
25
26
 
26
- def output(options)
27
+ def output(**options)
27
28
  @log = ::Logger.new($stdout) if options[:log_file].nil?
28
29
  @log = ::Logger.new(options[:log_file]) unless options[:log_file].nil?
29
30
  end
@@ -42,9 +43,7 @@ module Legion
42
43
 
43
44
  def log_level(level = 'info')
44
45
  log.level = case level
45
- when 'trace'
46
- ::Logger::DEBUG
47
- when 'debug'
46
+ when 'trace', 'debug'
48
47
  ::Logger::DEBUG
49
48
  when 'info'
50
49
  ::Logger::INFO
@@ -1,5 +1,5 @@
1
1
  module Legion
2
2
  module Logging
3
- VERSION = '1.1.3'.freeze
3
+ VERSION = '1.1.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: codecov
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -94,20 +80,6 @@ dependencies:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop-performance
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
83
  - !ruby/object:Gem::Dependency
112
84
  name: simplecov
113
85
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +140,7 @@ metadata:
168
140
  homepage_uri: https://bitbucket.org/legion-io/legion-logging
169
141
  source_code_uri: https://bitbucket.org/legion-io/legion-logging
170
142
  wiki_uri: https://bitbucket.org/legion-io/legion-logging/wiki/Home
171
- post_install_message:
143
+ post_install_message:
172
144
  rdoc_options: []
173
145
  require_paths:
174
146
  - lib
@@ -183,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
155
  - !ruby/object:Gem::Version
184
156
  version: '0'
185
157
  requirements: []
186
- rubygems_version: 3.1.2
187
- signing_key:
158
+ rubygems_version: 3.1.4
159
+ signing_key:
188
160
  specification_version: 4
189
161
  summary: The Legion::Logging class
190
162
  test_files: []