legion-logging 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +26 -4
- data/.idea/legion-logging.iml +28 -25
- data/.rubocop.yml +2 -1
- data/bitbucket-pipelines.yml +16 -13
- data/legion-logging.gemspec +2 -1
- data/lib/legion/logging/builder.rb +9 -8
- data/lib/legion/logging/logger.rb +1 -0
- data/lib/legion/logging/methods.rb +2 -2
- data/lib/legion/logging/version.rb +1 -1
- data/sonar-project.properties +12 -0
- metadata +23 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9ecd67d5e6c68af98e3b53869a576f4d9cfb4021498f66903bfd57b5ff533e1
|
4
|
+
data.tar.gz: 896e360f937631af59ea1cf4cba88be1baa8b6d23a432506c3c016db6c263f1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8d7e995ca4a2ed5f54636ebbe9fdea124f47caea4e0c43c5e65dcfc5f6716d770394cc94d033fbfacdb6d2cb3cc8d80319637485a62388362eb8468842c482f
|
7
|
+
data.tar.gz: 15f2613124940fbeee5868992c6ef7f53f3b10950d2bb835145309c4a82a8a67a92f3de1e23fdbb71a91e68c4f6ba67eab43ee98d549d4f9e1d3d3c214c5a8a3
|
data/.circleci/config.yml
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
version: 2.1
|
2
2
|
orbs:
|
3
3
|
ruby: circleci/ruby@0.2.1
|
4
|
+
sonarcloud: sonarsource/sonarcloud@1.0.1
|
4
5
|
|
5
6
|
jobs:
|
6
7
|
"rubocop":
|
7
8
|
docker:
|
8
|
-
- image: circleci/ruby:2.
|
9
|
+
- image: circleci/ruby:2.7-node
|
9
10
|
steps:
|
10
11
|
- checkout
|
11
12
|
- ruby/load-cache
|
@@ -17,20 +18,24 @@ jobs:
|
|
17
18
|
"ruby-two-five":
|
18
19
|
docker:
|
19
20
|
- image: circleci/ruby:2.5
|
20
|
-
- image: memcached:1.5-alpine
|
21
21
|
steps:
|
22
22
|
- checkout
|
23
23
|
- ruby/load-cache
|
24
|
+
- run:
|
25
|
+
name: update bundler
|
26
|
+
command: gem update bundler
|
24
27
|
- ruby/install-deps
|
25
28
|
- ruby/run-tests
|
26
29
|
- ruby/save-cache
|
27
30
|
"ruby-two-six":
|
28
31
|
docker:
|
29
32
|
- image: circleci/ruby:2.6
|
30
|
-
- image: memcached:1.5-alpine
|
31
33
|
steps:
|
32
34
|
- checkout
|
33
35
|
- ruby/load-cache
|
36
|
+
- run:
|
37
|
+
name: update bundler
|
38
|
+
command: gem update bundler
|
34
39
|
- ruby/install-deps
|
35
40
|
- ruby/run-tests
|
36
41
|
- ruby/save-cache
|
@@ -44,6 +49,19 @@ jobs:
|
|
44
49
|
- ruby/install-deps
|
45
50
|
- ruby/run-tests
|
46
51
|
- ruby/save-cache
|
52
|
+
"sonarcloud":
|
53
|
+
docker:
|
54
|
+
- image: circleci/ruby:2.7
|
55
|
+
steps:
|
56
|
+
- 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
|
63
|
+
- sonarcloud/scan
|
64
|
+
- ruby/save-cache
|
47
65
|
|
48
66
|
workflows:
|
49
67
|
version: 2
|
@@ -58,4 +76,8 @@ workflows:
|
|
58
76
|
- ruby-two-five
|
59
77
|
- ruby-two-seven:
|
60
78
|
requires:
|
61
|
-
- ruby-two-five
|
79
|
+
- ruby-two-five
|
80
|
+
- sonarcloud:
|
81
|
+
requires:
|
82
|
+
- ruby-two-seven
|
83
|
+
- ruby-two-six
|
data/.idea/legion-logging.iml
CHANGED
@@ -5,31 +5,34 @@
|
|
5
5
|
</component>
|
6
6
|
<component name="NewModuleRootManager">
|
7
7
|
<content url="file://$MODULE_DIR$" />
|
8
|
-
<orderEntry type="
|
8
|
+
<orderEntry type="jdk" jdkName="RVM: ruby-2.7.0" jdkType="RUBY_SDK" />
|
9
9
|
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
-
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.
|
11
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.
|
12
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
13
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
14
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
15
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
16
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
17
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
18
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
19
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
21
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-
|
26
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
28
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
29
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
30
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
31
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
32
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
33
|
-
<orderEntry type="library" scope="PROVIDED" name="
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="chef (v16.1.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="codecov (v0.2.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="colorize (v0.8.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.3.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="parser (v2.7.1.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v1.7.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.4, RVM: ruby-2.7.0) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.3, RVM: ruby-2.7.0) [gem]" level="application" />
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec_junit_formatter (v0.4.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.88.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v0.2.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.7.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.17.1, RVM: ruby-2.7.0) [gem]" level="application" />
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.2, RVM: ruby-2.7.0) [gem]" level="application" />
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.7.0, RVM: ruby-2.7.0) [gem]" level="application" />
|
34
37
|
</component>
|
35
38
|
</module>
|
data/.rubocop.yml
CHANGED
data/bitbucket-pipelines.yml
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
-
image: ruby:2.
|
1
|
+
image: ruby:2.7.0
|
2
2
|
|
3
3
|
pipelines:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
branches:
|
5
|
+
master:
|
6
|
+
- step:
|
7
|
+
name: Push to RubyGems
|
8
|
+
deployment: RubyGems
|
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)
|
15
|
+
- gem release
|
16
|
+
- gem tag --push
|
17
|
+
artifacts:
|
18
|
+
- pkg/**
|
data/legion-logging.gemspec
CHANGED
@@ -31,7 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'rspec'
|
32
32
|
spec.add_development_dependency 'rspec_junit_formatter'
|
33
33
|
spec.add_development_dependency 'rubocop'
|
34
|
-
spec.add_development_dependency '
|
34
|
+
spec.add_development_dependency 'rubocop-performance'
|
35
|
+
spec.add_development_dependency 'simplecov', '< 0.18.0'
|
35
36
|
|
36
37
|
spec.add_dependency 'rainbow', '~> 3'
|
37
38
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Legion
|
2
2
|
module Logging
|
3
3
|
module Builder
|
4
|
-
def log_format(options = {}, log = @log) # rubocop:disable Metrics/AbcSize
|
4
|
+
def log_format(options = {}, log = @log) # rubocop:disable Metrics/AbcSize
|
5
5
|
log.formatter = proc do |severity, datetime, _progname, msg|
|
6
6
|
options[:lex_name] = options.key?(:lex) ? "[lex-#{options[:lex]}]" : nil
|
7
7
|
unless options[:lex_name].nil?
|
@@ -28,18 +28,19 @@ module Legion
|
|
28
28
|
@log = ::Logger.new(options[:log_file]) unless options[:log_file].nil?
|
29
29
|
end
|
30
30
|
|
31
|
-
def log_level(level = '
|
32
|
-
|
31
|
+
def log_level(level = 'info', log = @log)
|
32
|
+
case level
|
33
|
+
when 'trace'
|
33
34
|
log.level = ::Logger::INFO
|
34
|
-
|
35
|
+
when 'debug'
|
35
36
|
log.level = ::Logger::DEBUG
|
36
|
-
|
37
|
+
when 'info'
|
37
38
|
log.level = ::Logger::INFO
|
38
|
-
|
39
|
+
when 'warn'
|
39
40
|
log.level = ::Logger::WARN
|
40
|
-
|
41
|
+
when 'error'
|
41
42
|
log.level = ::Logger::ERROR
|
42
|
-
|
43
|
+
when 'fatal'
|
43
44
|
log.level = ::Logger::FATAL
|
44
45
|
end
|
45
46
|
@log = log
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Legion
|
2
2
|
module Logging
|
3
3
|
module Methods
|
4
|
-
def trace(raw_message = nil, log = @log, size: @trace_size, log_caller: true) # rubocop:disable Metrics/
|
4
|
+
def trace(raw_message = nil, log = @log, size: @trace_size, log_caller: true) # rubocop:disable Metrics/PerceivedComplexity, Metrics/AbcSize
|
5
5
|
return unless @trace_enabled
|
6
6
|
|
7
7
|
raw_message = yield if raw_message.nil? && block_given?
|
@@ -68,7 +68,7 @@ module Legion
|
|
68
68
|
{ success: false, message: exc.message, backtrace: exc.backtrace }.merge(opts)
|
69
69
|
end
|
70
70
|
|
71
|
-
def thread(kvl: false)
|
71
|
+
def thread(kvl: false, **_opts)
|
72
72
|
if kvl
|
73
73
|
"thread=#{Thread.current.object_id}"
|
74
74
|
else
|
@@ -0,0 +1,12 @@
|
|
1
|
+
sonar.projectKey=legion-io_legion-logging
|
2
|
+
sonar.organization=legion-io
|
3
|
+
sonar.projectName=Legion::Logging
|
4
|
+
sonar.sources=.
|
5
|
+
sonar.exclusions=vendor/**
|
6
|
+
sonar.coverage.exclusions=spec/**
|
7
|
+
sonar.ruby.coverage.reportPath=coverage/.resultset.json
|
8
|
+
sonar.ruby.file.suffixes=rb,ruby
|
9
|
+
sonar.ruby.coverage.framework=RSpec
|
10
|
+
sonar.ruby.rubocopConfig=.rubocop.yml
|
11
|
+
sonar.ruby.rubocop.reportPath=rubocop-result.json
|
12
|
+
sonar.ruby.rubocop.filePath=.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legion-logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
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-
|
11
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rubocop-performance
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "<"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.18.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "<"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.18.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rainbow
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +154,7 @@ files:
|
|
140
154
|
- ".rubocop.yml"
|
141
155
|
- CHANGELOG.md
|
142
156
|
- Gemfile
|
157
|
+
- Gemfile.lock
|
143
158
|
- README.md
|
144
159
|
- Rakefile
|
145
160
|
- bitbucket-pipelines.yml
|
@@ -149,6 +164,7 @@ files:
|
|
149
164
|
- lib/legion/logging/logger.rb
|
150
165
|
- lib/legion/logging/methods.rb
|
151
166
|
- lib/legion/logging/version.rb
|
167
|
+
- sonar-project.properties
|
152
168
|
homepage: https://bitbucket.org/legion-io/legion-logging
|
153
169
|
licenses: []
|
154
170
|
metadata:
|
@@ -158,7 +174,7 @@ metadata:
|
|
158
174
|
homepage_uri: https://bitbucket.org/legion-io/legion-logging
|
159
175
|
source_code_uri: https://bitbucket.org/legion-io/legion-logging
|
160
176
|
wiki_uri: https://bitbucket.org/legion-io/legion-logging/wiki/Home
|
161
|
-
post_install_message:
|
177
|
+
post_install_message:
|
162
178
|
rdoc_options: []
|
163
179
|
require_paths:
|
164
180
|
- lib
|
@@ -173,8 +189,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
189
|
- !ruby/object:Gem::Version
|
174
190
|
version: '0'
|
175
191
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
177
|
-
signing_key:
|
192
|
+
rubygems_version: 3.1.2
|
193
|
+
signing_key:
|
178
194
|
specification_version: 4
|
179
195
|
summary: The Legion::Logging class
|
180
196
|
test_files: []
|