logcraft 2.1 → 2.2.1

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: e77bb5b3fd57a71991d2d62ad60b405d3aec4c204e9aca74d5b8aad73938fbce
4
- data.tar.gz: ef7f87bcb528b05c9d2a0499a50d00184a949f1d018091fe25e7b5fcacea535d
3
+ metadata.gz: 11f0babfb031a9f5e674f01b83410ceb62d31f13463bfe1df0e9ec6f4c597e93
4
+ data.tar.gz: '0167095c07490ce2200fc5fa84c938024bbb1b94f4dd11d2ea327ae009877521'
5
5
  SHA512:
6
- metadata.gz: eae1d4bfb0b539d0850fb306562244e73da2ff4a1745bdd378b9d10cb00dbedfa87938209327a8188bb9ca775827ba09ba1091f2a7a097417d85378cecabe2d0
7
- data.tar.gz: beb08ae116067d4feed050d8049cbbf97579fa00e905e669709ca0eb433ebfd1a13bef5dbdfbbed5ac85937704f5aa0b5671038f818a45165f29b7d51379393a
6
+ metadata.gz: 10513e0f20f07722672a14c4f15592a5825819ceed8af5ea3c752d2ff03c90f993e651e005f4cc8ab936869e795d26b046467e70cbdec9874f3e8b902229e132
7
+ data.tar.gz: 4f8c49167da207acbf3c3a780defa2ea1cd8f6f1acc6acc69774df2e654426833e3664f321e51e28de901d9278131c78a97d7a85cf16893131795ec16fea16e9
data/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ 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.2.1] - 2023-12-19
8
+ ### Fixed
9
+ - Fixed an issue where logs were duplicated (once in JSON, once in plain text) when running the Rails console.
10
+ (https://github.com/zormandi/logcraft/issues/7)
11
+ - Fixed an issue that prevented using Logcraft and Sentry-Rails together with the default configuration.
12
+ (https://github.com/zormandi/logcraft/issues/6)
13
+
14
+ ## [2.2] - 2023-10-23
15
+ ### Added
16
+ - Added support for Rails 7.1.
17
+
7
18
  ## [2.1] - 2023-06-13
8
19
  ### Added
9
20
  - Added support for custom log formatters.
data/Gemfile CHANGED
@@ -6,8 +6,8 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  group :test do
9
- gem 'rails', '~> 7.0.0'
10
- gem 'rspec-rails', '~> 4.0'
9
+ gem 'rails', '~> 7.1.0'
10
+ gem 'rspec-rails', '~> 6.0'
11
11
  gem 'sqlite3', '~> 1.4'
12
12
  gem 'net-smtp', require: false
13
13
  end
data/README.md CHANGED
@@ -17,7 +17,7 @@ Logcraft's purpose is threefold:
17
17
  Logcraft supports:
18
18
 
19
19
  * [Ruby](https://www.ruby-lang.org) 2.6 and up (tested with 2.6, 2.7, 3.0 and 3.1)
20
- * [Rails](https://rubyonrails.org/) 5 and up (tested with 5.2, 6.0, 6.1 and 7.0)
20
+ * [Rails](https://rubyonrails.org/) 5 and up (tested with 5.2, 6.0, 6.1, 7.0 and 7.1)
21
21
  * [Sidekiq](https://github.com/mperham/sidekiq) integration is provided via
22
22
  the [Logcraft::Sidekiq](https://github.com/zormandi/logcraft-sidekiq) gem
23
23
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in logcraft.gemspec
6
+ gemspec path: '..'
7
+
8
+ group :test do
9
+ gem 'rails', '~> 7.1.0'
10
+ gem 'rspec-rails', '~> 6.0'
11
+ gem 'sqlite3', '~> 1.4'
12
+ gem 'net-smtp', require: false
13
+ end
@@ -45,7 +45,11 @@ module Logcraft
45
45
  end
46
46
 
47
47
  config.before_configuration do |app|
48
- app.config.logger = Logcraft.logger 'Application'
48
+ app.config.logger = if defined? ActiveSupport::BroadcastLogger
49
+ ActiveSupport::BroadcastLogger.new Logcraft.logger('Application')
50
+ else
51
+ Logcraft.logger 'Application'
52
+ end
49
53
  app.config.log_level = ENV['LOG_LEVEL'] || :info
50
54
  end
51
55
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Ezlog
3
+ module Logcraft
4
4
  module RSpec
5
5
  module Helpers
6
6
  def log_output_is_expected
@@ -7,7 +7,7 @@ require_relative 'rspec/matchers'
7
7
  require_relative 'log_layout'
8
8
 
9
9
  RSpec.configure do |config|
10
- config.include Ezlog::RSpec::Helpers
10
+ config.include Logcraft::RSpec::Helpers
11
11
  config.before(:suite) do
12
12
  Logging.appenders.string_io('__logcraft_stringio__', layout: Logging.logger.root.appenders.first&.layout || Logcraft::LogLayout.new)
13
13
  config.capture_log_messages to: '__logcraft_stringio__'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logcraft
4
- VERSION = "2.1"
4
+ VERSION = "2.2.1"
5
5
  end
data/lib/logcraft.rb CHANGED
@@ -18,6 +18,14 @@ module Logcraft
18
18
  end
19
19
 
20
20
  def self.logger(name, level = nil)
21
- Logging::Logger[name].tap { |logger| logger.level = level if level }
21
+ Logging::Logger[name].tap do |logger|
22
+ logger.level = level if level
23
+ logger.instance_variable_set :@logdev, OpenStruct.new(dev: STDOUT)
24
+ logger.define_singleton_method :dup do
25
+ super().tap do |logger_copy|
26
+ Logging::Logger.define_log_methods logger_copy
27
+ end
28
+ end
29
+ end
22
30
  end
23
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logcraft
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoltan Ormandi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
- description:
83
+ description:
84
84
  email:
85
85
  - zoltan.ormandi@gmail.com
86
86
  executables: []
@@ -97,6 +97,7 @@ files:
97
97
  - gemfiles/rails_6.0.gemfile
98
98
  - gemfiles/rails_6.1.gemfile
99
99
  - gemfiles/rails_7.0.gemfile
100
+ - gemfiles/rails_7.1.gemfile
100
101
  - lib/logcraft.rb
101
102
  - lib/logcraft/log_context_helper.rb
102
103
  - lib/logcraft/log_layout.rb
@@ -120,7 +121,7 @@ metadata:
120
121
  homepage_uri: https://github.com/zormandi/logcraft
121
122
  source_code_uri: https://github.com/zormandi/logcraft
122
123
  changelog_uri: https://github.com/zormandi/logcraft/blob/main/CHANGELOG.md
123
- post_install_message:
124
+ post_install_message:
124
125
  rdoc_options: []
125
126
  require_paths:
126
127
  - lib
@@ -135,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
136
  - !ruby/object:Gem::Version
136
137
  version: '0'
137
138
  requirements: []
138
- rubygems_version: 3.1.6
139
- signing_key:
139
+ rubygems_version: 3.4.10
140
+ signing_key:
140
141
  specification_version: 4
141
142
  summary: A zero-configuration structured logging solution for pure Ruby or Ruby on
142
143
  Rails projects.