console 1.33.0 → 1.34.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/compatible/logger.rb +3 -1
- data/lib/console/output/serialized.rb +5 -2
- data/lib/console/output.rb +2 -2
- data/lib/console/version.rb +1 -1
- data/license.md +1 -0
- data/readme.md +9 -0
- data/releases.md +13 -4
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1e105eff33c8b3c21501315ffaf8e3e9e1e35c7002d6d60cab68e712a87625
|
4
|
+
data.tar.gz: 9929cfbfe13a26dadb5ae02687993c9dc345c8c56bc8ddd011a51deb2dd1e4b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c803e971b014100a6323fe7bc8ddc9349bcb9acac7d4d826433512846047c197aefbf6c4e0024733e0f8eb99c8035b19ebfcb48f7f533bcfb5d8fab34d584c8a
|
7
|
+
data.tar.gz: '069c760fbef1c8a488b49ef1d5c21e873e700cd3fe16968140d7ca273e544b3b0bacd30c9ff0d4ee76d22b4cea12d030dad69de5a95ed7c7814d13cc01e76087'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2022-2025, by Samuel Williams.
|
5
|
+
# Copyright, 2025, by Yasha Krasnou.
|
5
6
|
|
6
7
|
require "logger"
|
7
8
|
|
@@ -62,7 +63,7 @@ module Console
|
|
62
63
|
# @parameter message [String] The message to log.
|
63
64
|
# @parameter progname [String] The program name.
|
64
65
|
# @returns [Boolean] True if the message was logged.
|
65
|
-
def add(severity, message = nil, progname = nil)
|
66
|
+
def add(severity, message = nil, progname = nil, **options)
|
66
67
|
severity ||= UNKNOWN
|
67
68
|
|
68
69
|
if @logdev.nil? or severity < level
|
@@ -84,6 +85,7 @@ module Console
|
|
84
85
|
|
85
86
|
@logdev.call(
|
86
87
|
progname, message,
|
88
|
+
**options,
|
87
89
|
severity: format_severity(severity)
|
88
90
|
)
|
89
91
|
|
@@ -51,11 +51,13 @@ module Console
|
|
51
51
|
record = {
|
52
52
|
time: Time.now.iso8601,
|
53
53
|
severity: severity,
|
54
|
-
|
55
|
-
oid: subject.object_id,
|
54
|
+
process_id: Process.pid,
|
56
55
|
fiber_id: Fiber.current.object_id,
|
57
56
|
}
|
58
57
|
|
58
|
+
# For backwards compatibility:
|
59
|
+
record[:pid] = record[:process_id]
|
60
|
+
|
59
61
|
# We want to log just a brief subject:
|
60
62
|
if subject.is_a?(String)
|
61
63
|
record[:subject] = subject
|
@@ -63,6 +65,7 @@ module Console
|
|
63
65
|
record[:subject] = subject.name
|
64
66
|
else
|
65
67
|
record[:subject] = subject.class.name
|
68
|
+
record[:object_id] = subject.object_id
|
66
69
|
end
|
67
70
|
|
68
71
|
if annotation = Fiber.current.annotation
|
data/lib/console/output.rb
CHANGED
@@ -26,10 +26,10 @@ module Console
|
|
26
26
|
names = names.split(",").reverse
|
27
27
|
|
28
28
|
names.inject(output) do |output, name|
|
29
|
-
Output.const_get(name).new(output, **options)
|
29
|
+
Output.const_get(name).new(output, env: env, **options)
|
30
30
|
end
|
31
31
|
else
|
32
|
-
return Output::Default.new(output, **options)
|
32
|
+
return Output::Default.new(output, env: env, **options)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/lib/console/version.rb
CHANGED
data/license.md
CHANGED
@@ -12,6 +12,7 @@ Copyright, 2022, by William T. Nelson.
|
|
12
12
|
Copyright, 2023, by Felix Yan.
|
13
13
|
Copyright, 2024-2025, by Patrik Wenger.
|
14
14
|
Copyright, 2025, by Shigeru Nakajima.
|
15
|
+
Copyright, 2025, by Yasha Krasnou.
|
15
16
|
|
16
17
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
17
18
|
of this software and associated documentation files (the "Software"), to deal
|
data/readme.md
CHANGED
@@ -34,6 +34,15 @@ Please see the [project documentation](https://socketry.github.io/console/) for
|
|
34
34
|
|
35
35
|
Please see the [project releases](https://socketry.github.io/console/releases/index) for all releases.
|
36
36
|
|
37
|
+
### v1.34.1
|
38
|
+
|
39
|
+
- Add `process_id` to serialized output records for clarity (`pid` is still included for backwards compatibility).
|
40
|
+
- Add `object_id` to serialized output records **only** when the subject is not a string or class/module.
|
41
|
+
|
42
|
+
### v1.34.0
|
43
|
+
|
44
|
+
- Allow `Console::Compatible::Logger#add` to accept `**options`.
|
45
|
+
|
37
46
|
### v1.32.0
|
38
47
|
|
39
48
|
- Add `fiber_id` to serialized output records to help identify which fiber logged the message.
|
data/releases.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
+
## v1.34.1
|
4
|
+
|
5
|
+
- Add `process_id` to serialized output records for clarity (`pid` is still included for backwards compatibility).
|
6
|
+
- Add `object_id` to serialized output records **only** when the subject is not a string or class/module.
|
7
|
+
|
8
|
+
## v1.34.0
|
9
|
+
|
10
|
+
- Allow `Console::Compatible::Logger#add` to accept `**options`.
|
11
|
+
|
3
12
|
## v1.32.0
|
4
13
|
|
5
14
|
- Add `fiber_id` to serialized output records to help identify which fiber logged the message.
|
@@ -14,9 +23,9 @@ The console library now works correctly with Ruby's Ractor concurrency model. Pr
|
|
14
23
|
``` ruby
|
15
24
|
# This now works without errors:
|
16
25
|
ractor = Ractor.new do
|
17
|
-
|
18
|
-
|
19
|
-
|
26
|
+
require "console"
|
27
|
+
Console.info("Hello from Ractor!")
|
28
|
+
"Ractor completed successfully"
|
20
29
|
end
|
21
30
|
|
22
31
|
result = ractor.take
|
@@ -77,7 +86,7 @@ def make_logger(output = $stderr, env = ENV, **options)
|
|
77
86
|
# Custom logger configuration with verbose output:
|
78
87
|
options[:verbose] = true
|
79
88
|
|
80
|
-
|
89
|
+
Logger.new(output, **options)
|
81
90
|
end
|
82
91
|
```
|
83
92
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.34.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -16,6 +16,7 @@ authors:
|
|
16
16
|
- Olle Jonsson
|
17
17
|
- Shigeru Nakajima
|
18
18
|
- William T. Nelson
|
19
|
+
- Yasha Krasnou
|
19
20
|
bindir: bin
|
20
21
|
cert_chain:
|
21
22
|
- |
|
@@ -153,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
154
|
- !ruby/object:Gem::Version
|
154
155
|
version: '0'
|
155
156
|
requirements: []
|
156
|
-
rubygems_version: 3.6.
|
157
|
+
rubygems_version: 3.6.9
|
157
158
|
specification_version: 4
|
158
159
|
summary: Beautiful logging for Ruby.
|
159
160
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|