loog 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9a2f247a4b679ce501ac06be9ddc71e1160cffc5543c473790a76595d43fb1b
4
- data.tar.gz: 0636e22a352a85d4cbdb9a5fd56078f11e069f40655daf179b48360c609bbf12
3
+ metadata.gz: 24a9b7c949c59f3d192ac930021849397245b1a33cce4a43000c6fd13748e14a
4
+ data.tar.gz: 4d04114153ed31769072bbd9d49e4dd40ef7df030f268bb93b4ee6c825e35ecb
5
5
  SHA512:
6
- metadata.gz: 70d45cf5bad47a905c1ed9de0b7568b0058a53fad61e838d6da32c7c8f81da5ef5589cfc31fb991467ea5ff8b468738b367f9ee68971166a1971f48abcae88a5
7
- data.tar.gz: 864737a3e8ec72571a814af4dc964d7af165e80aa3cb44aae152e9f939774d7ab005cedf9e9f5cd90a8ee9954ebc216da86e89025e6a2f5cb43f92187384ed2f
6
+ metadata.gz: cbb8ed22c86bb468c81c2b338da1737f586973e3bcba3a3d73b48a1bf0a3134ebd95c5ddc54d48ee9e75308264b9ff1aaac471dfa19dd08b217439f73c7536a6
7
+ data.tar.gz: 129e6642f6586c5f56b42c3d63dbe6ad3900b074b61e2e35be159a6eee67dcc0a33fc1f6e1e9bbc1407c7ed7c1c6083c477a5f6a73e7dc9772545991fafab361
data/.0pdd.yml CHANGED
@@ -1,22 +1,5 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  errors:
22
5
  - yegor256@gmail.com
@@ -1,23 +1,7 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: actionlint
22
6
  'on':
23
7
  push:
@@ -28,12 +12,12 @@ name: actionlint
28
12
  - master
29
13
  jobs:
30
14
  actionlint:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - name: Download actionlint
35
20
  id: get_actionlint
36
- # yamllint disable-line rule:line-length
37
21
  run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38
22
  shell: bash
39
23
  - name: Check workflow files
@@ -1,38 +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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: codecov
22
- on:
6
+ 'on':
23
7
  push:
24
8
  branches:
25
9
  - master
26
10
  jobs:
27
11
  codecov:
28
- runs-on: ubuntu-22.04
12
+ timeout-minutes: 15
13
+ runs-on: ubuntu-24.04
29
14
  steps:
30
15
  - uses: actions/checkout@v4
31
16
  - uses: actions/setup-ruby@v1
32
17
  with:
33
- ruby-version: 3.2
34
- - run: bundle update
18
+ ruby-version: 3.3
19
+ bundler-cache: true
20
+ - run: bundle config set --global path "$(pwd)/vendor/bundle"
21
+ - run: bundle install --no-color
35
22
  - run: bundle exec rake
36
- - uses: codecov/codecov-action@v4.0.0-beta.3
23
+ - uses: codecov/codecov-action@v5
37
24
  with:
38
25
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,30 +1,15 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: copyrights
22
6
  'on':
23
7
  push:
24
8
  pull_request:
25
9
  jobs:
26
10
  copyrights:
27
- runs-on: ubuntu-22.04
11
+ timeout-minutes: 15
12
+ runs-on: ubuntu-24.04
28
13
  steps:
29
14
  - uses: actions/checkout@v4
30
- - uses: yegor256/copyrights-action@0.0.5
15
+ - uses: yegor256/copyrights-action@0.0.8
@@ -1,23 +1,7 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: markdown-lint
22
6
  'on':
23
7
  push:
@@ -32,7 +16,8 @@ concurrency:
32
16
  cancel-in-progress: true
33
17
  jobs:
34
18
  markdown-lint:
35
- runs-on: ubuntu-22.04
19
+ timeout-minutes: 15
20
+ runs-on: ubuntu-24.04
36
21
  steps:
37
22
  - uses: actions/checkout@v4
38
23
  - uses: articulate/actions-markdownlint@v1
@@ -1,25 +1,9 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: pdd
22
- on:
6
+ 'on':
23
7
  push:
24
8
  branches:
25
9
  - master
@@ -28,7 +12,8 @@ on:
28
12
  - master
29
13
  jobs:
30
14
  pdd:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - uses: volodya-lombrozo/pdd-action@master
@@ -1,25 +1,9 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: rake
22
- on:
6
+ 'on':
23
7
  push:
24
8
  branches:
25
9
  - master
@@ -28,16 +12,17 @@ on:
28
12
  - master
29
13
  jobs:
30
14
  test:
31
- name: test
32
15
  strategy:
33
16
  matrix:
34
- os: [ubuntu-22.04]
35
- ruby: [3.2]
17
+ os: [ubuntu-24.04]
18
+ ruby: [3.3]
36
19
  runs-on: ${{ matrix.os }}
37
20
  steps:
38
21
  - uses: actions/checkout@v4
39
22
  - uses: ruby/setup-ruby@v1
40
23
  with:
41
24
  ruby-version: ${{ matrix.ruby }}
42
- - run: bundle update
25
+ bundler-cache: true
26
+ - run: bundle config set --global path "$(pwd)/vendor/bundle"
27
+ - run: bundle install --no-color
43
28
  - run: bundle exec rake
@@ -0,0 +1,19 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+ ---
4
+ # yamllint disable rule:line-length
5
+ name: reuse
6
+ 'on':
7
+ push:
8
+ branches:
9
+ - master
10
+ pull_request:
11
+ branches:
12
+ - master
13
+ jobs:
14
+ reuse:
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: fsfe/reuse-action@v5
@@ -0,0 +1,19 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+ ---
4
+ # yamllint disable rule:line-length
5
+ name: typos
6
+ 'on':
7
+ push:
8
+ branches:
9
+ - master
10
+ pull_request:
11
+ branches:
12
+ - master
13
+ jobs:
14
+ typos:
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: crate-ci/typos@v1.32.0
@@ -1,23 +1,7 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  name: xcop
22
6
  "on":
23
7
  push:
@@ -28,7 +12,8 @@ name: xcop
28
12
  - master
29
13
  jobs:
30
14
  xcop:
31
- runs-on: ubuntu-22.04
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
32
17
  steps:
33
18
  - uses: actions/checkout@v4
34
19
  - uses: g4s8/xcop-action@master
@@ -0,0 +1,19 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+ ---
4
+ # yamllint disable rule:line-length
5
+ name: yamllint
6
+ 'on':
7
+ push:
8
+ branches:
9
+ - master
10
+ pull_request:
11
+ branches:
12
+ - master
13
+ jobs:
14
+ yamllint:
15
+ timeout-minutes: 15
16
+ runs-on: ubuntu-24.04
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: ibiqlik/action-yamllint@v3
data/.gitignore CHANGED
@@ -1,6 +1,12 @@
1
- Gemfile.lock
2
- *.gem
3
1
  .bundle/
4
2
  .DS_Store
5
- rdoc/
3
+ .idea/
4
+ .yardoc/
5
+ *.gem
6
6
  coverage/
7
+ doc/
8
+ node_modules/
9
+ rdoc/
10
+ vendor/
11
+
12
+ **/.claude/settings.local.json
data/.rubocop.yml CHANGED
@@ -1,29 +1,17 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
21
4
  AllCops:
22
5
  DisplayCopNames: true
23
6
  TargetRubyVersion: 2.3.3
24
7
  SuggestExtensions: false
25
8
  NewCops: enable
26
-
9
+ plugins:
10
+ - rubocop-rake
11
+ - rubocop-minitest
12
+ - rubocop-performance
13
+ Minitest/EmptyLineBeforeAssertionMethods:
14
+ Enabled: false
27
15
  Layout/EmptyLineAfterGuardClause:
28
16
  Enabled: false
29
17
  Layout/MultilineMethodCallIndentation:
data/.rultor.yml CHANGED
@@ -1,31 +1,16 @@
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
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
20
3
  ---
4
+ # yamllint disable rule:line-length
21
5
  docker:
22
- image: yegor256/rultor-image:1.23.1
6
+ image: yegor256/ruby
23
7
  assets:
24
8
  rubygems.yml: yegor256/home#assets/rubygems.yml
25
9
  install: |
26
10
  pdd -f /dev/null
27
11
  sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
28
12
  release:
13
+ pre: false
29
14
  script: |-
30
15
  bundle exec rake
31
16
  rm -rf *.gem
data/Gemfile CHANGED
@@ -1,31 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  source 'https://rubygems.org'
24
7
  gemspec
25
8
 
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
- gem 'simplecov', '0.22.0', require: false
9
+ gem 'minitest', '~>5.25', require: false
10
+ gem 'minitest-reporters', '~>1.7', require: false
11
+ gem 'rake', '~>13.2', require: false
12
+ gem 'rdoc', '~>6.11', require: false
13
+ gem 'rubocop', '~>1.71', require: false
14
+ gem 'rubocop-minitest', '>0', require: false
15
+ gem 'rubocop-performance', '>0', require: false
16
+ gem 'rubocop-rake', '>0', require: false
17
+ gem 'rubocop-rspec', '>0', require: false
18
+ gem 'simplecov', '~>0.22', require: false
19
+ gem 'simplecov-cobertura', '~>2.1', require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,105 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ loog (0.0.0)
5
+ logger (~> 1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ansi (1.5.0)
11
+ ast (2.4.3)
12
+ builder (3.3.0)
13
+ date (3.4.1)
14
+ docile (1.4.1)
15
+ json (2.11.3)
16
+ language_server-protocol (3.17.0.4)
17
+ lint_roller (1.1.0)
18
+ logger (1.7.0)
19
+ minitest (5.25.5)
20
+ minitest-reporters (1.7.1)
21
+ ansi
22
+ builder
23
+ minitest (>= 5.0)
24
+ ruby-progressbar
25
+ parallel (1.27.0)
26
+ parser (3.3.8.0)
27
+ ast (~> 2.4.1)
28
+ racc
29
+ prism (1.4.0)
30
+ psych (5.2.4)
31
+ date
32
+ stringio
33
+ racc (1.8.1)
34
+ rainbow (3.1.1)
35
+ rake (13.2.1)
36
+ rdoc (6.13.1)
37
+ psych (>= 4.0.0)
38
+ regexp_parser (2.10.0)
39
+ rexml (3.4.1)
40
+ rubocop (1.75.5)
41
+ json (~> 2.3)
42
+ language_server-protocol (~> 3.17.0.2)
43
+ lint_roller (~> 1.1.0)
44
+ parallel (~> 1.10)
45
+ parser (>= 3.3.0.2)
46
+ rainbow (>= 2.2.2, < 4.0)
47
+ regexp_parser (>= 2.9.3, < 3.0)
48
+ rubocop-ast (>= 1.44.0, < 2.0)
49
+ ruby-progressbar (~> 1.7)
50
+ unicode-display_width (>= 2.4.0, < 4.0)
51
+ rubocop-ast (1.44.1)
52
+ parser (>= 3.3.7.2)
53
+ prism (~> 1.4)
54
+ rubocop-minitest (0.38.0)
55
+ lint_roller (~> 1.1)
56
+ rubocop (>= 1.75.0, < 2.0)
57
+ rubocop-ast (>= 1.38.0, < 2.0)
58
+ rubocop-performance (1.25.0)
59
+ lint_roller (~> 1.1)
60
+ rubocop (>= 1.75.0, < 2.0)
61
+ rubocop-ast (>= 1.38.0, < 2.0)
62
+ rubocop-rake (0.7.1)
63
+ lint_roller (~> 1.1)
64
+ rubocop (>= 1.72.1)
65
+ rubocop-rspec (3.6.0)
66
+ lint_roller (~> 1.1)
67
+ rubocop (~> 1.72, >= 1.72.1)
68
+ ruby-progressbar (1.13.0)
69
+ simplecov (0.22.0)
70
+ docile (~> 1.1)
71
+ simplecov-html (~> 0.11)
72
+ simplecov_json_formatter (~> 0.1)
73
+ simplecov-cobertura (2.1.0)
74
+ rexml
75
+ simplecov (~> 0.19)
76
+ simplecov-html (0.13.1)
77
+ simplecov_json_formatter (0.1.4)
78
+ stringio (3.1.7)
79
+ unicode-display_width (3.1.4)
80
+ unicode-emoji (~> 4.0, >= 4.0.4)
81
+ unicode-emoji (4.0.4)
82
+
83
+ PLATFORMS
84
+ arm64-darwin-22
85
+ arm64-darwin-23
86
+ arm64-darwin-24
87
+ x64-mingw-ucrt
88
+ x86_64-linux
89
+
90
+ DEPENDENCIES
91
+ loog!
92
+ minitest (~> 5.25)
93
+ minitest-reporters (~> 1.7)
94
+ rake (~> 13.2)
95
+ rdoc (~> 6.11)
96
+ rubocop (~> 1.71)
97
+ rubocop-minitest (> 0)
98
+ rubocop-performance (> 0)
99
+ rubocop-rake (> 0)
100
+ rubocop-rspec (> 0)
101
+ simplecov (~> 0.22)
102
+ simplecov-cobertura (~> 2.1)
103
+
104
+ BUNDLED WITH
105
+ 2.5.16
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2018-2024 Yegor Bugayenko
3
+ Copyright (c) 2018-2025 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/LICENSES/MIT.txt ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2018-2025 Yegor Bugayenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the 'Software'), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
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
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/loog)](http://www.rultor.com/p/yegor256/loog)
4
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/loog)](https://www.rultor.com/p/yegor256/loog)
5
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
7
  [![rake](https://github.com/yegor256/loog/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/loog/actions/workflows/rake.yml)
8
- [![Gem Version](https://badge.fury.io/rb/loog.svg)](http://badge.fury.io/rb/loog)
8
+ [![Gem Version](https://badge.fury.io/rb/loog.svg)](https://badge.fury.io/rb/loog)
9
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/4346229c7af42b820e84/maintainability)](https://codeclimate.com/github/yegor256/loog/maintainability)
10
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/loog/master/frames)
10
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/loog/master/frames)
11
11
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/loog.svg)](https://codecov.io/github/yegor256/loog?branch=master)
12
12
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/loog)](https://hitsofcode.com/view/github/yegor256/loog)
13
13
 
@@ -35,11 +35,23 @@ 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
+ Also, you can "tee" two loogs, with the help of `Loog::Tee`. For example,
39
+ to record everything in a buffer and also show in the console:
40
+
41
+ ```ruby
42
+ require 'loog'
43
+ require 'loog/tee'
44
+ buf = Loog::Buffer.new
45
+ loog = Loog::Tee.new(Loog::VERBOSE, buf)
46
+ loog.info('Hello, world!')
47
+ assert(buf.to_s.include?('Hello'))
48
+ ```
49
+
38
50
  ## How to contribute
39
51
 
40
52
  Read
41
53
  [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
42
- Make sure you build is green before you contribute
54
+ Make sure your build is green before you contribute
43
55
  your pull request. You will need to have
44
56
  [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
45
57
  [Bundler](https://bundler.io/) installed. Then:
data/REUSE.toml ADDED
@@ -0,0 +1,36 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ ".DS_Store",
8
+ ".gitattributes",
9
+ ".gitignore",
10
+ ".pdd",
11
+ "**.json",
12
+ "**.md",
13
+ "**.png",
14
+ "**.svg",
15
+ "**.txt",
16
+ "**/.DS_Store",
17
+ "**/.gitignore",
18
+ "**/.pdd",
19
+ "**/*.csv",
20
+ "**/*.jpg",
21
+ "**/*.json",
22
+ "**/*.md",
23
+ "**/*.pdf",
24
+ "**/*.png",
25
+ "**/*.svg",
26
+ "**/*.txt",
27
+ "**/*.vm",
28
+ "**/CNAME",
29
+ "**/Gemfile.lock",
30
+ "Gemfile.lock",
31
+ "README.md",
32
+ "renovate.json",
33
+ ]
34
+ precedence = "override"
35
+ SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
36
+ SPDX-License-Identifier = "MIT"
data/Rakefile CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rubygems'
24
7
  require 'rake'
@@ -54,5 +37,4 @@ end
54
37
  require 'rubocop/rake_task'
55
38
  RuboCop::RakeTask.new(:rubocop) do |task|
56
39
  task.fail_on_error = true
57
- task.requires << 'rubocop-rspec'
58
40
  end
data/lib/loog/tee.rb CHANGED
@@ -1,39 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  require_relative '../loog'
26
7
 
27
8
  # A combiner of a few logs together:
28
9
  #
29
10
  # require 'loog'
11
+ # require 'loog/tee'
30
12
  # tee = Loog::Tee.new(Loog::VERBOSE, file_logger)
31
- # log.info('Hello, world!')
13
+ # tee.info('Hello, world!')
32
14
  #
33
15
  # This way you can log to console and to the file at the same time.
34
16
  #
35
17
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
36
- # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
18
+ # Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
37
19
  # License:: MIT
38
20
  class Loog::Tee
39
21
  # Makes an instance.
@@ -46,7 +28,7 @@ class Loog::Tee
46
28
  end
47
29
 
48
30
  def debug?
49
- @logs.any? { |g| g.debug?(msg) }
31
+ @logs.any?(&:debug?)
50
32
  end
51
33
 
52
34
  def info(msg)
@@ -54,7 +36,7 @@ class Loog::Tee
54
36
  end
55
37
 
56
38
  def info?
57
- @logs.any? { |g| g.info?(msg) }
39
+ @logs.any?(&:info?)
58
40
  end
59
41
 
60
42
  def warn(msg)
@@ -62,10 +44,14 @@ class Loog::Tee
62
44
  end
63
45
 
64
46
  def warn?
65
- @logs.any? { |g| g.warn?(msg) }
47
+ @logs.any?(&:warn?)
66
48
  end
67
49
 
68
50
  def error(msg)
69
51
  @logs.each { |g| g.error(msg) }
70
52
  end
53
+
54
+ def error?
55
+ @logs.any?(&:error?)
56
+ end
71
57
  end
data/lib/loog.rb CHANGED
@@ -1,26 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  require 'logger'
26
7
  require 'time'
@@ -35,7 +16,7 @@ require 'time'
35
16
  # {README}[https://github.com/yegor256/loog/blob/master/README.md] file.
36
17
  #
37
18
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
38
- # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
19
+ # Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
39
20
  # License:: MIT
40
21
  module Loog
41
22
  # Compact formatter
@@ -47,21 +28,24 @@ module Loog
47
28
  when 'DEBUG'
48
29
  prefix = 'D: '
49
30
  end
50
- "#{prefix}#{msg.to_s.rstrip.gsub("\n", "\n#{' ' * prefix.length}")}\n"
31
+ message = msg.to_s.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
32
+ "#{prefix}#{message.rstrip.gsub("\n", "\n#{' ' * prefix.length}")}\n"
51
33
  end
52
34
 
53
35
  # Short formatter
54
36
  SHORT = proc do |_severity, _time, _target, msg|
55
- "#{msg.to_s.rstrip}\n"
37
+ message = msg.to_s.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
38
+ "#{message.rstrip}\n"
56
39
  end
57
40
 
58
41
  # Full formatter
59
42
  FULL = proc do |severity, time, _target, msg|
43
+ message = msg.to_s.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
60
44
  format(
61
45
  "%<time>s %<severity>5s %<msg>s\n",
62
46
  time: time.utc.iso8601,
63
47
  severity: severity,
64
- msg: msg.to_s.rstrip
48
+ msg: message.rstrip
65
49
  )
66
50
  end
67
51
 
@@ -109,7 +93,7 @@ module Loog
109
93
  end
110
94
 
111
95
  def to_s
112
- @lines.map { |s| s.dup.force_encoding('UTF-8') }.join
96
+ @lines.map { |s| s.dup.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?') }.join
113
97
  end
114
98
  end
115
99
  end
data/logo.svg CHANGED
@@ -16,4 +16,4 @@
16
16
  </g>
17
17
  </g>
18
18
  </g>
19
- </svg>
19
+ </svg>
data/loog.gemspec CHANGED
@@ -1,33 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  require 'English'
26
7
  Gem::Specification.new do |s|
27
8
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
28
9
  s.required_ruby_version = '>=2.3'
29
10
  s.name = 'loog'
30
- s.version = '0.6.0'
11
+ s.version = '0.6.1'
31
12
  s.license = 'MIT'
32
13
  s.summary = 'Object-oriented logging wrapper'
33
14
  s.description = 'Object-oriented wrapper for Ruby default logging facility'
@@ -37,5 +18,6 @@ Gem::Specification.new do |s|
37
18
  s.files = `git ls-files`.split($RS)
38
19
  s.rdoc_options = ['--charset=UTF-8']
39
20
  s.extra_rdoc_files = ['README.md']
21
+ s.add_dependency 'logger', '~>1.0'
40
22
  s.metadata['rubygems_mfa_required'] = 'true'
41
23
  end
data/test/test__helper.rb CHANGED
@@ -1,28 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  $stdout.sync = true
26
7
 
27
8
  require 'simplecov'
28
- SimpleCov.start
9
+ require 'simplecov-cobertura'
10
+ unless SimpleCov.running || ENV['PICKS']
11
+ SimpleCov.command_name('test')
12
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
13
+ [
14
+ SimpleCov::Formatter::HTMLFormatter,
15
+ SimpleCov::Formatter::CoberturaFormatter
16
+ ]
17
+ )
18
+ SimpleCov.minimum_coverage 90
19
+ SimpleCov.minimum_coverage_by_file 80
20
+ SimpleCov.start do
21
+ add_filter 'test/'
22
+ add_filter 'vendor/'
23
+ add_filter 'target/'
24
+ track_files 'lib/**/*.rb'
25
+ track_files '*.rb'
26
+ end
27
+ end
28
+
29
+ require 'minitest/autorun'
30
+ require 'minitest/reporters'
31
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]
data/test/test_loog.rb CHANGED
@@ -1,33 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  require 'minitest/autorun'
26
7
  require_relative '../lib/loog'
27
8
 
28
9
  # Loog test.
29
10
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
11
+ # Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
31
12
  # License:: MIT
32
13
  class LoogTest < Minitest::Test
33
14
  def test_simple_logging
@@ -45,8 +26,8 @@ class LoogTest < Minitest::Test
45
26
  b.warn('Hello, world!')
46
27
  b.error('Hello, world!')
47
28
  stdout = b.to_s
48
- assert(stdout.include?('Hello'))
49
- assert(stdout.include?('DEBUG'))
29
+ assert_includes(stdout, 'Hello')
30
+ assert_includes(stdout, 'DEBUG')
50
31
  end
51
32
 
52
33
  def test_quiet_buffering
@@ -63,6 +44,20 @@ class LoogTest < Minitest::Test
63
44
  b.debug('привет')
64
45
  b.debug(msg)
65
46
  stdout = b.to_s
66
- assert(stdout.include?('AB'), stdout)
47
+ assert_includes(stdout, 'AB', stdout)
48
+ end
49
+
50
+ def test_handles_invalid_utf8_without_exception
51
+ broken = "\xFF\xFE\x12"
52
+ Loog::VERBOSE.info(broken)
53
+ Loog::REGULAR.info(broken)
54
+ Loog::ERRORS.error(broken)
55
+ b = Loog::Buffer.new
56
+ b.info(broken)
57
+ output = b.to_s
58
+ assert_match(/\?+/, output)
59
+ b = Loog::Buffer.new(formatter: Loog::FULL)
60
+ b.info(broken)
61
+ assert_match(/\?+/, b.to_s)
67
62
  end
68
63
  end
data/test/test_tee.rb CHANGED
@@ -1,26 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # (The MIT License)
4
- #
5
- # Copyright (c) 2018-2024 Yegor Bugayenko
6
- #
7
- # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the 'Software'), to deal
9
- # in the Software without restriction, including without limitation the rights
10
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- # copies of the Software, and to permit persons to whom the Software is
12
- # furnished to do so, subject to the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be included in all
15
- # copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
24
5
 
25
6
  require 'minitest/autorun'
26
7
  require_relative '../lib/loog'
@@ -28,7 +9,7 @@ require_relative '../lib/loog/tee'
28
9
 
29
10
  # Loog::Tee test.
30
11
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
- # Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
12
+ # Copyright:: Copyright (c) 2018-2025 Yegor Bugayenko
32
13
  # License:: MIT
33
14
  class TeeTest < Minitest::Test
34
15
  def test_simple_logging
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-03 00:00:00.000000000 Z
12
- dependencies: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.0'
13
26
  description: Object-oriented wrapper for Ruby default logging facility
14
27
  email: yegor256@gmail.com
15
28
  executables: []
@@ -25,15 +38,20 @@ files:
25
38
  - ".github/workflows/markdown-lint.yml"
26
39
  - ".github/workflows/pdd.yml"
27
40
  - ".github/workflows/rake.yml"
41
+ - ".github/workflows/reuse.yml"
42
+ - ".github/workflows/typos.yml"
28
43
  - ".github/workflows/xcop.yml"
44
+ - ".github/workflows/yamllint.yml"
29
45
  - ".gitignore"
30
46
  - ".pdd"
31
47
  - ".rubocop.yml"
32
48
  - ".rultor.yml"
33
- - ".simplecov"
34
49
  - Gemfile
50
+ - Gemfile.lock
35
51
  - LICENSE.txt
52
+ - LICENSES/MIT.txt
36
53
  - README.md
54
+ - REUSE.toml
37
55
  - Rakefile
38
56
  - lib/loog.rb
39
57
  - lib/loog/tee.rb
@@ -48,7 +66,6 @@ licenses:
48
66
  - MIT
49
67
  metadata:
50
68
  rubygems_mfa_required: 'true'
51
- post_install_message:
52
69
  rdoc_options:
53
70
  - "--charset=UTF-8"
54
71
  require_paths:
@@ -64,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
81
  - !ruby/object:Gem::Version
65
82
  version: '0'
66
83
  requirements: []
67
- rubygems_version: 3.4.10
68
- signing_key:
84
+ rubygems_version: 3.6.7
69
85
  specification_version: 4
70
86
  summary: Object-oriented logging wrapper
71
87
  test_files: []
data/.simplecov DELETED
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright (c) 2019 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- if Gem.win_platform?
24
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
25
- SimpleCov::Formatter::HTMLFormatter
26
- ]
27
- SimpleCov.start do
28
- add_filter '/test/'
29
- add_filter '/features/'
30
- end
31
- else
32
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
33
- [SimpleCov::Formatter::HTMLFormatter]
34
- )
35
- SimpleCov.start do
36
- add_filter '/test/'
37
- add_filter '/features/'
38
- minimum_coverage 60
39
- end
40
- end