lumberjack 2.0.0 → 2.0.2
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/VERSION +1 -1
- data/lib/lumberjack/forked_logger.rb +1 -1
- data/lib/lumberjack/logger.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b76516c0e871b68e2834d0517dd219eefd0985fd55894c48e8e8c4fa9e71be8
|
|
4
|
+
data.tar.gz: 2516f75995e1ca98a7d0daabf5ea71b1a3a2e4593966a955bac9bc66dea5827e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6df7a99b4b8bba7a694cdcb45053185b7f2d40bb18af18af354e0188eba00b2f04156536e0844c0ddc74e38e3661821e60b357d4eef8928a3de6bd2bf0af1da
|
|
7
|
+
data.tar.gz: ad698517a3a54969c582d6cb839c218894a89b301c137bf2bdc08889777d50343ca4ccaf26d4a40ae96bfd3601790481267729e15eadc4d8f2cc7abbc687fd06
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ 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.0.2
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Attempts to use the logger inside a logging call (e.g. from a in a formatter) will now print the log message to STDERR. Previously such log messages would be silently dropped in order to prevent infinite recursion.
|
|
12
|
+
|
|
13
|
+
## 2.0.1
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Merge attributes in forked loggers in the correct order so that attributes from the forked logger override those from the parent logger.
|
|
18
|
+
|
|
7
19
|
## 2.0.0
|
|
8
20
|
|
|
9
21
|
This is a major update with several breaking changes. See the [upgrade guide](UPGRADE_GUIDE.md) for details on breaking changes.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.2
|
|
@@ -85,7 +85,7 @@ module Lumberjack
|
|
|
85
85
|
# @api private
|
|
86
86
|
def add_entry(severity, message, progname = nil, attributes = nil)
|
|
87
87
|
parent_logger.with_level(level || Logger::DEBUG) do
|
|
88
|
-
attributes = merge_attributes(
|
|
88
|
+
attributes = merge_attributes(local_attributes, attributes)
|
|
89
89
|
progname ||= self.progname
|
|
90
90
|
|
|
91
91
|
if parent_logger.is_a?(ContextLogger)
|
data/lib/lumberjack/logger.rb
CHANGED
|
@@ -396,7 +396,12 @@ module Lumberjack
|
|
|
396
396
|
# @api private
|
|
397
397
|
def add_entry(severity, message, progname = nil, attributes = nil)
|
|
398
398
|
return false unless device
|
|
399
|
-
|
|
399
|
+
|
|
400
|
+
# Prevent infinite recursion if logging is attempted from within a logging call.
|
|
401
|
+
if fiber_local&.logging
|
|
402
|
+
log_to_stderr(severity, message)
|
|
403
|
+
return false
|
|
404
|
+
end
|
|
400
405
|
|
|
401
406
|
severity = Severity.label_to_level(severity) unless severity.is_a?(Integer)
|
|
402
407
|
|
|
@@ -503,5 +508,11 @@ module Lumberjack
|
|
|
503
508
|
|
|
504
509
|
positional_arg_count == 4 && !has_forbidden_args
|
|
505
510
|
end
|
|
511
|
+
|
|
512
|
+
def log_to_stderr(severity, message)
|
|
513
|
+
severity = Severity.coerce(severity)
|
|
514
|
+
severity_label = Severity.level_to_label(severity)
|
|
515
|
+
$stderr.write("Recursive logging detected; you cannot write new log entries while logging other entries: #{severity_label} #{message}\n")
|
|
516
|
+
end
|
|
506
517
|
end
|
|
507
518
|
end
|