loog 0.5.1 → 0.5.3

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: e1ff618d0107b8ec12ffd303cee8926274b2a8a37593ba60eeece9a1c071a7b3
4
- data.tar.gz: 44cee88f20b6da00bbd425d9faf718295613bd9e786d0344228c054e4d819373
3
+ metadata.gz: 9c5b47cdc5645f17254a2e7aaae37b614bfb72d4da2214956727223dae990a25
4
+ data.tar.gz: 0f0d4140f159bc4b319221dd91ab842769890166d52e2c4485c7c6179f343bea
5
5
  SHA512:
6
- metadata.gz: 3d5d4f85a2281ed8348bd4cb871d4903fc49eed43d3221592f8d5ed9f89a16fa49d5c493e1e691ffabc182fd4ba33ba911ef903411faf8f0d8d2c5cdfab431d9
7
- data.tar.gz: 7e6a683fa912743f79d479fef4ae75d7248015158a947aeff80d8705de100499239841185daaf6e4d296eff7a78644bc8bda677a4dc2ddff9cb3e9c608c18d3a
6
+ metadata.gz: 581adf7dae6b421179d02146ab5b4b966689d306c5a35ea31811e3e4feb912bb138e8c1e6424474ad081d308bd08acb443b064e8f0e940d8a1ecac8c82d85c62
7
+ data.tar.gz: 9646ce3a439a25f9fe83fd0ac0e3825806643c16f918927eef4b100a67e0d9a7257b4609d50261c3ca90fb8e943ca7ac9d428a4038c04aa2832faf972dd69602
data/.0pdd.yml CHANGED
@@ -1,3 +1,23 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
1
21
  errors:
2
22
  - yegor256@gmail.com
3
23
  # alerts:
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: actionlint
22
+ 'on':
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ jobs:
30
+ actionlint:
31
+ runs-on: ubuntu-22.04
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Download actionlint
35
+ id: get_actionlint
36
+ # yamllint disable-line rule:line-length
37
+ run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38
+ shell: bash
39
+ - name: Check workflow files
40
+ run: ${{ steps.get_actionlint.outputs.executable }} -color
41
+ shell: bash
@@ -1,3 +1,22 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
1
20
  ---
2
21
  name: codecov
3
22
  on:
@@ -6,15 +25,14 @@ on:
6
25
  - master
7
26
  jobs:
8
27
  codecov:
9
- runs-on: ubuntu-20.04
28
+ runs-on: ubuntu-22.04
10
29
  steps:
11
- - uses: actions/checkout@v3
30
+ - uses: actions/checkout@v4
12
31
  - uses: actions/setup-ruby@v1
13
32
  with:
14
- ruby-version: 2.7
33
+ ruby-version: 3.2
15
34
  - run: bundle update
16
35
  - run: bundle exec rake
17
- - uses: codecov/codecov-action@v3
36
+ - uses: codecov/codecov-action@v4.0.0-beta.3
18
37
  with:
19
- file: coverage/.resultset.json
20
- fail_ci_if_error: true
38
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,30 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: copyrights
22
+ 'on':
23
+ push:
24
+ pull_request:
25
+ jobs:
26
+ copyrights:
27
+ runs-on: ubuntu-22.04
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: yegor256/copyrights-action@0.0.5
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
21
+ name: markdown-lint
22
+ 'on':
23
+ push:
24
+ branches:
25
+ - master
26
+ pull_request:
27
+ branches:
28
+ - master
29
+ paths-ignore: ['paper/**', 'sandbox/**']
30
+ concurrency:
31
+ group: markdown-lint-${{ github.ref }}
32
+ cancel-in-progress: true
33
+ jobs:
34
+ markdown-lint:
35
+ runs-on: ubuntu-22.04
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: articulate/actions-markdownlint@v1
@@ -1,6 +1,25 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
1
20
  ---
2
21
  name: pdd
3
- "on":
22
+ on:
4
23
  push:
5
24
  branches:
6
25
  - master
@@ -9,7 +28,7 @@ name: pdd
9
28
  - master
10
29
  jobs:
11
30
  pdd:
12
- runs-on: ubuntu-20.04
31
+ runs-on: ubuntu-22.04
13
32
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: g4s8/pdd-action@master
33
+ - uses: actions/checkout@v4
34
+ - uses: volodya-lombrozo/pdd-action@master
@@ -1,3 +1,22 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
1
20
  ---
2
21
  name: rake
3
22
  on:
@@ -12,11 +31,11 @@ jobs:
12
31
  name: test
13
32
  strategy:
14
33
  matrix:
15
- os: [ubuntu-20.04]
16
- ruby: [2.7, 3.0]
34
+ os: [ubuntu-22.04]
35
+ ruby: [3.2]
17
36
  runs-on: ${{ matrix.os }}
18
37
  steps:
19
- - uses: actions/checkout@v3
38
+ - uses: actions/checkout@v4
20
39
  - uses: ruby/setup-ruby@v1
21
40
  with:
22
41
  ruby-version: ${{ matrix.ruby }}
@@ -1,3 +1,22 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
1
20
  ---
2
21
  name: xcop
3
22
  "on":
@@ -9,9 +28,9 @@ name: xcop
9
28
  - master
10
29
  jobs:
11
30
  xcop:
12
- runs-on: ubuntu-20.04
31
+ runs-on: ubuntu-22.04
13
32
  steps:
14
- - uses: actions/checkout@v3
33
+ - uses: actions/checkout@v4
15
34
  - uses: g4s8/xcop-action@master
16
35
  with:
17
36
  files: '**/*.xml'
data/.rubocop.yml CHANGED
@@ -1,3 +1,23 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
1
21
  AllCops:
2
22
  DisplayCopNames: true
3
23
  TargetRubyVersion: 2.3.3
data/.rultor.yml CHANGED
@@ -1,5 +1,25 @@
1
+ # Copyright (c) 2018-2024 Yegor Bugayenko
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the 'Software'), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in all
11
+ # copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ # SOFTWARE.
20
+ ---
1
21
  docker:
2
- image: yegor256/rultor-image:1.21.0
22
+ image: yegor256/rultor-image:1.23.1
3
23
  assets:
4
24
  rubygems.yml: yegor256/home#assets/rubygems.yml
5
25
  install: |
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2023 Yegor Bugayenko
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -23,9 +23,9 @@
23
23
  source 'https://rubygems.org'
24
24
  gemspec
25
25
 
26
- gem 'minitest', '5.19.0', require: false
27
- gem 'rake', '13.0.6', require: false
28
- gem 'rdoc', '6.5.0', require: false
29
- gem 'rubocop', '1.54.2', require: false
30
- gem 'rubocop-rspec', '2.22.0', require: false
26
+ gem 'minitest', '5.24.1', require: false
27
+ gem 'rake', '13.2.1', require: false
28
+ gem 'rdoc', '6.7.0', require: false
29
+ gem 'rubocop', '1.65.1', require: false
30
+ gem 'rubocop-rspec', '3.0.3', require: false
31
31
  gem 'simplecov', '0.22.0', require: false
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2019 Yegor Bugayenko
3
+ Copyright (c) 2018-2024 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <img src="/logo.svg" width="64px" height="64px"/>
1
+ # Object-Oriented Logger for Ruby
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
4
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/loog)](http://www.rultor.com/p/yegor256/loog)
@@ -17,7 +17,7 @@ Loog is an object-oriented logging wrapper around Ruby
17
17
  First, install it:
18
18
 
19
19
  ```bash
20
- $ gem install loog
20
+ gem install loog
21
21
  ```
22
22
 
23
23
  Then, use it like this:
@@ -31,21 +31,22 @@ The gem is basically a provider of a few pre-configured loggers, which
31
31
  you can use for production (`Loog::REGULAR`) or for testing (`Loog::VERBOSE`).
32
32
  You can also shut it up with `Loog::NULL`.
33
33
 
34
- There is also `Logger::Buffer` class that you can use for testing.
34
+ There is also `Loog::Buffer` class that you can use for testing.
35
35
  It accumulates all log calls and then returns the entire output
36
36
  through the `to_s()` method.
37
37
 
38
38
  ## How to contribute
39
39
 
40
- Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
40
+ Read
41
+ [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
41
42
  Make sure you build is green before you contribute
42
- your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
43
+ your pull request. You will need to have
44
+ [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
43
45
  [Bundler](https://bundler.io/) installed. Then:
44
46
 
45
- ```
46
- $ bundle update
47
- $ bundle exec rake
47
+ ```bash
48
+ bundle update
49
+ bundle exec rake
48
50
  ```
49
51
 
50
52
  If it's clean and you don't see any error messages, submit your pull request.
51
-
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2023 Yegor Bugayenko
3
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
data/lib/loog/tee.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2023 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -33,7 +33,7 @@ require_relative '../loog'
33
33
  # This way you can log to console and to the file at the same time.
34
34
  #
35
35
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
36
- # Copyright:: Copyright (c) 2018-2023 Yegor Bugayenko
36
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
37
37
  # License:: MIT
38
38
  class Loog::Tee
39
39
  # Makes an instance.
@@ -57,6 +57,14 @@ class Loog::Tee
57
57
  @logs.any? { |g| g.info?(msg) }
58
58
  end
59
59
 
60
+ def warn(msg)
61
+ @logs.each { |g| g.warn(msg) }
62
+ end
63
+
64
+ def warn?
65
+ @logs.any? { |g| g.warn?(msg) }
66
+ end
67
+
60
68
  def error(msg)
61
69
  @logs.each { |g| g.error(msg) }
62
70
  end
data/lib/loog.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2023 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -23,6 +23,7 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  require 'logger'
26
+ require 'time'
26
27
 
27
28
  # Loog is an object-oriented wrapper around Ruby Logger:
28
29
  #
@@ -34,7 +35,7 @@ require 'logger'
34
35
  # {README}[https://github.com/yegor256/loog/blob/master/README.md] file.
35
36
  #
36
37
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
37
- # Copyright:: Copyright (c) 2018-2023 Yegor Bugayenko
38
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
38
39
  # License:: MIT
39
40
  module Loog
40
41
  # Compact formatter
@@ -105,7 +106,7 @@ module Loog
105
106
  end
106
107
 
107
108
  def to_s
108
- @lines.join
109
+ @lines.map { |s| s.dup.force_encoding('UTF-8') }.join
109
110
  end
110
111
  end
111
112
  end
data/loog.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2023 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
28
28
  s.required_ruby_version = '>=2.3'
29
29
  s.name = 'loog'
30
- s.version = '0.5.1'
30
+ s.version = '0.5.3'
31
31
  s.license = 'MIT'
32
32
  s.summary = 'Object-oriented logging wrapper'
33
33
  s.description = 'Object-oriented wrapper for Ruby default logging facility'
data/test/test__helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2019 Yegor Bugayenko
3
+ # (The MIT License)
4
+ #
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
4
6
  #
5
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -14,7 +16,7 @@
14
16
  #
15
17
  # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
18
  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
20
  # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
21
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
data/test/test_loog.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2023 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +27,7 @@ require_relative '../lib/loog'
27
27
 
28
28
  # Loog test.
29
29
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018-2023 Yegor Bugayenko
30
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
31
31
  # License:: MIT
32
32
  class LoogTest < Minitest::Test
33
33
  def test_simple_logging
@@ -41,6 +41,9 @@ class LoogTest < Minitest::Test
41
41
  def test_buffering
42
42
  b = Loog::Buffer.new(formatter: Loog::FULL)
43
43
  b.debug('Hello, world!')
44
+ b.info('Hello, world!')
45
+ b.warn('Hello, world!')
46
+ b.error('Hello, world!')
44
47
  stdout = b.to_s
45
48
  assert(stdout.include?('Hello'))
46
49
  assert(stdout.include?('DEBUG'))
@@ -49,8 +52,17 @@ class LoogTest < Minitest::Test
49
52
  def test_quiet_buffering
50
53
  b = Loog::Buffer.new
51
54
  b.info('Hey, друг!')
52
- b.info('Bye!')
53
- b.info('+')
55
+ b.warn('Bye!')
56
+ b.error('+')
54
57
  assert_equal("Hey, друг!\nBye!\n+\n", b.to_s)
55
58
  end
59
+
60
+ def test_buffer_non_utf
61
+ b = Loog::Buffer.new
62
+ msg = [0x41, 0x42, 0xC0].pack('c*')
63
+ b.debug('привет')
64
+ b.debug(msg)
65
+ stdout = b.to_s
66
+ assert(stdout.include?('AB'), stdout)
67
+ end
56
68
  end
data/test/test_tee.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # (The MIT License)
4
4
  #
5
- # Copyright (c) 2018-2023 Yegor Bugayenko
5
+ # Copyright (c) 2018-2024 Yegor Bugayenko
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the 'Software'), to deal
@@ -28,10 +28,14 @@ require_relative '../lib/loog/tee'
28
28
 
29
29
  # Loog::Tee test.
30
30
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
- # Copyright:: Copyright (c) 2018-2023 Yegor Bugayenko
31
+ # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
32
32
  # License:: MIT
33
33
  class TeeTest < Minitest::Test
34
34
  def test_simple_logging
35
- Loog::Tee.new(Loog::VERBOSE, Loog::REGULAR).info('Works?')
35
+ tee = Loog::Tee.new(Loog::VERBOSE, Loog::REGULAR)
36
+ tee.info('Works?')
37
+ tee.debug('Works?')
38
+ tee.warn('Works?')
39
+ tee.error('Works?')
36
40
  end
37
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-28 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Object-oriented wrapper for Ruby default logging facility
14
14
  email: yegor256@gmail.com
@@ -19,7 +19,10 @@ extra_rdoc_files:
19
19
  files:
20
20
  - ".0pdd.yml"
21
21
  - ".gitattributes"
22
+ - ".github/workflows/actionlint.yml"
22
23
  - ".github/workflows/codecov.yml"
24
+ - ".github/workflows/copyrights.yml"
25
+ - ".github/workflows/markdown-lint.yml"
23
26
  - ".github/workflows/pdd.yml"
24
27
  - ".github/workflows/rake.yml"
25
28
  - ".github/workflows/xcop.yml"
@@ -28,12 +31,10 @@ files:
28
31
  - ".rubocop.yml"
29
32
  - ".rultor.yml"
30
33
  - ".simplecov"
31
- - ".travis.yml"
32
34
  - Gemfile
33
35
  - LICENSE.txt
34
36
  - README.md
35
37
  - Rakefile
36
- - appveyor.yml
37
38
  - lib/loog.rb
38
39
  - lib/loog/tee.rb
39
40
  - logo.svg
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  - !ruby/object:Gem::Version
64
65
  version: '0'
65
66
  requirements: []
66
- rubygems_version: 3.2.15
67
+ rubygems_version: 3.4.10
67
68
  signing_key:
68
69
  specification_version: 4
69
70
  summary: Object-oriented logging wrapper
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.0
4
- cache: bundler
5
- branches:
6
- only:
7
- - master
8
- install:
9
- - travis_retry bundle update
10
- script:
11
- - rake
12
- after_success:
13
- - "bash <(curl -s https://codecov.io/bash)"
data/appveyor.yml DELETED
@@ -1,21 +0,0 @@
1
- version: '{build}'
2
- skip_tags: true
3
- clone_depth: 10
4
- branches:
5
- only:
6
- - master
7
- except:
8
- - gh-pages
9
- os: Windows Server 2012
10
- install:
11
- - cmd: SET PATH=C:\Ruby23-x64\bin;%PATH%
12
- - cmd: ruby --version
13
- - cmd: git --version
14
- build_script:
15
- - bundle update
16
- - bundle install
17
- test_script:
18
- - bundle exec rake
19
- cache:
20
- - C:\Ruby200\bin -> loog.gemspec
21
- - C:\Ruby200\lib\ruby\gems\2.0.0 -> loog.gemspec