logcraft 2.2.1 → 2.3

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: 11f0babfb031a9f5e674f01b83410ceb62d31f13463bfe1df0e9ec6f4c597e93
4
- data.tar.gz: '0167095c07490ce2200fc5fa84c938024bbb1b94f4dd11d2ea327ae009877521'
3
+ metadata.gz: cf02f8ae6ffa5dead32fea6f287d8e85c39acfb14fe2678223312cbb7c3ffd0c
4
+ data.tar.gz: 8b22305887593aa695eec3f47fb0b9d88d2097bbfd2a2e1a42e14caa345a7e79
5
5
  SHA512:
6
- metadata.gz: 10513e0f20f07722672a14c4f15592a5825819ceed8af5ea3c752d2ff03c90f993e651e005f4cc8ab936869e795d26b046467e70cbdec9874f3e8b902229e132
7
- data.tar.gz: 4f8c49167da207acbf3c3a780defa2ea1cd8f6f1acc6acc69774df2e654426833e3664f321e51e28de901d9278131c78a97d7a85cf16893131795ec16fea16e9
6
+ metadata.gz: d6a6fa0a3686bbc4f73f76eac8a91537c1ac22aa2f10ab72611a70f1f52ec3876af08ac0c80536276141529685620b67e25b5eee057513daaabf95495fc27645
7
+ data.tar.gz: 6ea6f6a1f737d225ad4153506071b6f1cdfcafb722c423ea37695861c5880c3313a779c3f084bb49a409d99b3a599034a586554ce82917a5302487a8d0d35eba
data/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.3] - 2026-07-28
8
+ ### Changed
9
+ - Replaced `OpenStruct` with a plain `Struct` for the internal STDOUT log device, removing the reliance on
10
+ `ostruct` — which is no longer a default gem in current Ruby versions. The Struct is now created once and
11
+ shared instead of per logger.
12
+ (https://github.com/zormandi/logcraft/pull/13, https://github.com/zormandi/logcraft/pull/14)
13
+
14
+ Thanks to [@jbigler](https://github.com/jbigler) for both contributions.
15
+
7
16
  ## [2.2.1] - 2023-12-19
8
17
  ### Fixed
9
18
  - Fixed an issue where logs were duplicated (once in JSON, once in plain text) when running the Rails console.
@@ -9,4 +9,6 @@ group :test do
9
9
  gem 'rails', '~> 5.2.0'
10
10
  gem 'rspec-rails', '~> 4.0'
11
11
  gem 'sqlite3', '~> 1.4'
12
+ # concurrent-ruby >= 1.3.5 dropped its internal "logger" require, which breaks Active Support < 7.1.
13
+ gem 'concurrent-ruby', '< 1.3.5'
12
14
  end
@@ -9,4 +9,6 @@ group :test do
9
9
  gem 'rails', '~> 6.0.0'
10
10
  gem 'rspec-rails', '~> 4.0'
11
11
  gem 'sqlite3', '~> 1.4'
12
+ # concurrent-ruby >= 1.3.5 dropped its internal "logger" require, which breaks Active Support < 7.1.
13
+ gem 'concurrent-ruby', '< 1.3.5'
12
14
  end
@@ -9,5 +9,7 @@ group :test do
9
9
  gem 'rails', '~> 6.1.0'
10
10
  gem 'rspec-rails', '~> 4.0'
11
11
  gem 'sqlite3', '~> 1.4'
12
+ # concurrent-ruby >= 1.3.5 dropped its internal "logger" require, which breaks Active Support < 7.1.
13
+ gem 'concurrent-ruby', '< 1.3.5'
12
14
  gem 'net-smtp', require: false
13
15
  end
@@ -9,5 +9,7 @@ group :test do
9
9
  gem 'rails', '~> 7.0.0'
10
10
  gem 'rspec-rails', '~> 4.0'
11
11
  gem 'sqlite3', '~> 1.4'
12
+ # concurrent-ruby >= 1.3.5 dropped its internal "logger" require, which breaks Active Support < 7.1.
13
+ gem 'concurrent-ruby', '< 1.3.5'
12
14
  gem 'net-smtp', require: false
13
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logcraft
4
- VERSION = "2.2.1"
4
+ VERSION = "2.3"
5
5
  end
data/lib/logcraft.rb CHANGED
@@ -12,6 +12,8 @@ module Logcraft
12
12
 
13
13
  extend LogContextHelper
14
14
 
15
+ STDOUT_LOG_DEVICE = Struct.new(:dev).new(STDOUT).freeze
16
+
15
17
  def self.initialize(log_level: :info, global_context: {}, layout_options: {})
16
18
  Logging.logger.root.appenders = Logging.appenders.stdout layout: LogLayout.new(global_context, layout_options)
17
19
  Logging.logger.root.level = log_level
@@ -20,7 +22,7 @@ module Logcraft
20
22
  def self.logger(name, level = nil)
21
23
  Logging::Logger[name].tap do |logger|
22
24
  logger.level = level if level
23
- logger.instance_variable_set :@logdev, OpenStruct.new(dev: STDOUT)
25
+ logger.instance_variable_set :@logdev, STDOUT_LOG_DEVICE
24
26
  logger.define_singleton_method :dup do
25
27
  super().tap do |logger_copy|
26
28
  Logging::Logger.define_log_methods logger_copy
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logcraft
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoltan Ormandi
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2023-12-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: logging
@@ -80,7 +79,6 @@ dependencies:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
81
  version: '3.0'
83
- description:
84
82
  email:
85
83
  - zoltan.ormandi@gmail.com
86
84
  executables: []
@@ -121,7 +119,6 @@ metadata:
121
119
  homepage_uri: https://github.com/zormandi/logcraft
122
120
  source_code_uri: https://github.com/zormandi/logcraft
123
121
  changelog_uri: https://github.com/zormandi/logcraft/blob/main/CHANGELOG.md
124
- post_install_message:
125
122
  rdoc_options: []
126
123
  require_paths:
127
124
  - lib
@@ -136,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
133
  - !ruby/object:Gem::Version
137
134
  version: '0'
138
135
  requirements: []
139
- rubygems_version: 3.4.10
140
- signing_key:
136
+ rubygems_version: 4.0.17
141
137
  specification_version: 4
142
138
  summary: A zero-configuration structured logging solution for pure Ruby or Ruby on
143
139
  Rails projects.