console 1.29.3 → 1.30.0

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/console/capture.rb +26 -1
  4. data/lib/console/clock.rb +6 -1
  5. data/lib/console/compatible/logger.rb +30 -1
  6. data/lib/console/config.rb +93 -0
  7. data/lib/console/event/failure.rb +32 -3
  8. data/lib/console/event/generic.rb +14 -0
  9. data/lib/console/event/spawn.rb +38 -6
  10. data/lib/console/event.rb +6 -0
  11. data/lib/console/filter.rb +62 -2
  12. data/lib/console/format/safe.rb +35 -7
  13. data/lib/console/format.rb +3 -0
  14. data/lib/console/interface.rb +17 -9
  15. data/lib/console/logger.rb +22 -37
  16. data/lib/console/output/default.rb +11 -5
  17. data/lib/console/output/failure.rb +8 -1
  18. data/lib/console/output/null.rb +4 -1
  19. data/lib/console/output/sensitive.rb +41 -0
  20. data/lib/console/output/serialized.rb +25 -4
  21. data/lib/console/output/split.rb +11 -0
  22. data/lib/console/output/terminal.rb +66 -14
  23. data/lib/console/output/wrapper.rb +11 -0
  24. data/lib/console/output.rb +11 -0
  25. data/lib/console/progress.rb +55 -8
  26. data/lib/console/resolver.rb +18 -1
  27. data/lib/console/terminal/formatter/failure.rb +17 -5
  28. data/lib/console/terminal/formatter/progress.rb +15 -2
  29. data/lib/console/terminal/formatter/spawn.rb +15 -4
  30. data/lib/console/terminal/formatter.rb +16 -0
  31. data/lib/console/terminal/text.rb +60 -19
  32. data/lib/console/terminal/xterm.rb +16 -1
  33. data/lib/console/terminal.rb +6 -8
  34. data/lib/console/version.rb +1 -1
  35. data/lib/console/warn.rb +1 -1
  36. data/lib/console.rb +1 -0
  37. data/readme.md +7 -1
  38. data/releases.md +24 -1
  39. data.tar.gz.sig +0 -0
  40. metadata +4 -2
  41. metadata.gz.sig +0 -0
data/readme.md CHANGED
@@ -24,6 +24,8 @@ Please see the [project documentation](https://socketry.github.io/console/) for
24
24
 
25
25
  - [Command Line](https://socketry.github.io/console/guides/command-line/index) - This guide explains how the `console` gem can be controlled using environment variables.
26
26
 
27
+ - [Configuration](https://socketry.github.io/console/guides/configuration/index) - This guide explains how to implement per-project configuration for the `console` gem.
28
+
27
29
  - [Integration](https://socketry.github.io/console/guides/integration/index) - This guide explains how to integrate the `console` output into different systems.
28
30
 
29
31
  - [Events](https://socketry.github.io/console/guides/events/index) - This guide explains how to log structured events with a well-defined schema.
@@ -32,6 +34,10 @@ Please see the [project documentation](https://socketry.github.io/console/) for
32
34
 
33
35
  Please see the [project releases](https://socketry.github.io/console/releases/index) for all releases.
34
36
 
37
+ ### v1.30.0
38
+
39
+ - [Introduce `Console::Config` for fine grained configuration.](https://socketry.github.io/console/releases/index#introduce-console::config-for-fine-grained-configuration.)
40
+
35
41
  ### v1.29.3
36
42
 
37
43
  - Serialized output now uses `IO#write` with a single string to reduce the chance of interleaved output.
@@ -48,7 +54,7 @@ Please see the [project releases](https://socketry.github.io/console/releases/in
48
54
 
49
55
  - Don't make `Kernel#warn` redirection to `Console.warn` the default behavior, you must `require 'console/warn'` to enable it.
50
56
  - Remove deprecated `Console::Logger#failure`.
51
- - [Consistent Handling of Exceptions](https://socketry.github.io/console/releases/index#consistent-handling-of-exceptions)
57
+ - [Consistent handling of exceptions.](https://socketry.github.io/console/releases/index#consistent-handling-of-exceptions.)
52
58
 
53
59
  ### v1.28.0
54
60
 
data/releases.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Releases
2
2
 
3
+ ## v1.30.0
4
+
5
+ ### Introduce `Console::Config` for fine grained configuration.
6
+
7
+ Introduced a new explicit configuration interface via config/console.rb to enhance logging setup in complex applications. This update gives the application code an opportunity to load files if required and control aspects such as log level, output, and more. Users can override default behaviors (e.g., make\_output, make\_logger, and log\_level) for improved customization.
8
+
9
+ ``` ruby
10
+ # config/console.rb
11
+ def log_level(env = ENV)
12
+ # Set a custom log level, e.g., force debug mode:
13
+ :debug
14
+ end
15
+
16
+ def make_logger(output = $stderr, env = ENV, **options)
17
+ # Custom logger configuration with verbose output:
18
+ options[:verbose] = true
19
+
20
+ Logger.new(output, **options)
21
+ end
22
+ ```
23
+
24
+ This approach provides a standard way to hook into the log setup process, allowing tailored adjustments for reliable and customizable logging behavior.
25
+
3
26
  ## v1.29.3
4
27
 
5
28
  - Serialized output now uses `IO#write` with a single string to reduce the chance of interleaved output.
@@ -17,7 +40,7 @@
17
40
  - Don't make `Kernel#warn` redirection to `Console.warn` the default behavior, you must `require 'console/warn'` to enable it.
18
41
  - Remove deprecated `Console::Logger#failure`.
19
42
 
20
- ### Consistent Handling of Exceptions
43
+ ### Consistent handling of exceptions.
21
44
 
22
45
  `Console.call` and all wrapper methods will now consistently handle exceptions that are the last positional argument or keyword argument. This means that the following code will work as expected:
23
46
 
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.29.3
4
+ version: 1.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -46,7 +46,7 @@ cert_chain:
46
46
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
47
47
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
48
48
  -----END CERTIFICATE-----
49
- date: 2025-02-19 00:00:00.000000000 Z
49
+ date: 2025-03-07 00:00:00.000000000 Z
50
50
  dependencies:
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: fiber-annotation
@@ -100,6 +100,7 @@ files:
100
100
  - lib/console/capture.rb
101
101
  - lib/console/clock.rb
102
102
  - lib/console/compatible/logger.rb
103
+ - lib/console/config.rb
103
104
  - lib/console/event.rb
104
105
  - lib/console/event/failure.rb
105
106
  - lib/console/event/generic.rb
@@ -121,6 +122,7 @@ files:
121
122
  - lib/console/progress.rb
122
123
  - lib/console/resolver.rb
123
124
  - lib/console/terminal.rb
125
+ - lib/console/terminal/formatter.rb
124
126
  - lib/console/terminal/formatter/failure.rb
125
127
  - lib/console/terminal/formatter/progress.rb
126
128
  - lib/console/terminal/formatter/spawn.rb
metadata.gz.sig CHANGED
Binary file