Commit 63cfcc2
authored
Tutorials edits - Terminate on configuration error - Terminal Color (#2368)
* refactor: minor
* feat: terminal colors
* feat: reorganized utility classes into 'text' and 'xml' packages, added new `TerminalColors` and `XMLTextUtil` classes
- Moved text-related utilities to `com.predic8.membrane.core.util.text` package.
- Introduced `TerminalColors` class for ANSI terminal color handling.
- Added `XMLTextUtil` class with utilities for XML formatting and validation.
- Updated class references and imports across the codebase to reflect package restructuring.
- Enhanced logging configuration to support color highlighting.
* refactor: cleanup unused methods, enhance type-checking, and suppress warnings
- Removed redundant methods no longer in use (`waitForAsynchronousInitialization`, `isAsynchronousInitialization`).
- Improved type-checking with modern Java features (e.g., `instanceof` with variable binding).
- Refined helper method signatures to reduce unnecessary parameters.
- Suppressed unused warning in `TerminalColors`.
- Updated exception types to match method requirements.
* refactor: adjust default behavior in `TerminalColors` and improve code consistency
- Changed fallback return value in `TerminalColors` to `false` for safer behavior.
- Updated exception type in `XMLTextUtil` to match method operations.
- Refined imports in `GrammarMock` for conciseness.
- Removed unused exceptions in `HttpServerHandler` to simplify method signatures.
* fix: improve OS detection logic and update roadmap for 7.1.0 prep
- Corrected OS detection for Windows by using full "windows" string match.
- Added 7.1.0 section to the roadmap, noting JSON Schema registration.
* refactor: Fixed OSUtil win vs. windows, consolidate `StringUtil` and `TextUtil` usage, reorganize utility imports, and fix minor inconsistencies
* refactor: simplify imports in `TextUtilTest` and `TerminalColors` by consolidating wildcard usage
* feat: enhance logging with terminal color support and improve OS utility methods
- Added colorized logging for different log levels using `TerminalColors`.
- Refined `OSUtil` with new constants, IntelliJ/VSCode detection, and JVM argument helper.
- Simplified ANSI support detection logic in `TerminalColors`.
* refactor: streamline OS utility methods and terminal color logic
- Removed redundant imports and simplified method calls in `TerminalColors` and `OSUtil`.
- Unified OS detection patterns for macOS, Windows, and Linux/Unix systems.
- Improved readability and consistency in terminal color support logic.
* feat: enhance terminal color support and fix OS detection issues
- Added system property `MEMBRANE_COLORS` to enable/disable terminal color logging explicitly.
- Fixed null-safe access in OS detection methods.
- Corrected method naming inconsistencies in `OSUtil` and `TerminalColors`.
* feat: improve terminal environment handling and simplify ANSI support detection
- Added new constants for terminal environment variables in `OSUtil`.
- Introduced `isDumbTerminal` method for enhanced Linux/Unix support.
- Refactored `detectAnsiSupport` in `TerminalColors` for better readability and logic reuse.
* refactor: rename terminal color environment variable and property for consistency
- Updated `MEMBRANE_COLORS` to `MEMBRANE_TERM_COLORS` and added new system property `membrane.term.colors`.
- Adjusted references in `LogInterceptor`, `TerminalColors`, and `Constants`.
- Improved logic in `TerminalColors` for explicit fallback handling.
* feat: add support for disabling terminal colors via environment variable and property
- Introduced `MEMBRANE_DISABLE_TERM_COLORS` environment variable and `membrane.disable.term.colors` system property.
- Updated `TerminalColors`, `Constants`, and log4j2 configuration files to support new variables.
- Adjusted ANSI support detection logic to accommodate the disable feature.
* refactor: remove `isDumbTerminal` method and inline logic in `TerminalColors`
- Simplified terminal color detection by inlining `isDumbTerminal` logic directly into `TerminalColors`.
- Removed unused method from `OSUtil`.
* feat: enhance and standardize terminal color support
- Implemented detailed environment-based terminal color detection in shell and batch scripts.
- Deprecated redundant methods in `OSUtil` while streamlining color detection logic in `TerminalColors`.
- Updated log configuration files to support standardized `membrane.disable.term.colors` system property.
- Improved user control over terminal colors with clear case-insensitive environment overrides.
* feat: add `membrane.disable.term.colors` system property to batch script
- Extended `start_router.cmd` to include `JAVA_OPTS` for disabling terminal colors.
* feat: extend terminal compatibility detection in shell script
- Added support for WezTerm, Alacritty, and Kitty in `start_router.sh`.
- Minor formatting adjustment in `TerminalColors`.
* feat: extend terminal compatibility detection in shell script
- Added support for WezTerm, Alacritty, and Kitty in `start_router.sh`.
- Minor formatting adjustment in `TerminalColors`.1 parent f5a416c commit 63cfcc2
47 files changed
Lines changed: 603 additions & 100 deletions
File tree
- annot/src/main/java/com/predic8/membrane/annot
- generator
- yaml
- core/src
- main/java/com/predic8/membrane/core
- exchangestore
- graphql
- http
- interceptor
- acl
- matchers
- administration
- groovy
- javascript
- jwt
- log
- access
- rewrite
- schemavalidation
- server
- xml
- xslt
- lang/javascript
- openapi/serviceproxy
- prettifier
- proxies
- transport/http
- util
- text
- xml
- test
- java/com/predic8/membrane/core
- http
- interceptor/schemavalidation
- util
- resources
- distribution
- conf
- router/conf
- scripts
- tutorials/getting-started
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | | - | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
Lines changed: 11 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
358 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
359 | 365 | | |
360 | 366 | | |
361 | 367 | | |
| |||
662 | 668 | | |
663 | 669 | | |
664 | 670 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | 671 | | |
670 | 672 | | |
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | 676 | | |
685 | 677 | | |
686 | 678 | | |
687 | 679 | | |
688 | | - | |
| 680 | + | |
689 | 681 | | |
690 | 682 | | |
691 | 683 | | |
692 | 684 | | |
693 | 685 | | |
694 | | - | |
| 686 | + | |
695 | 687 | | |
696 | 688 | | |
697 | 689 | | |
698 | | - | |
699 | 690 | | |
700 | 691 | | |
701 | 692 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
| 626 | + | |
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
639 | | - | |
| 639 | + | |
640 | 640 | | |
641 | | - | |
| 641 | + | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
| 712 | + | |
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
| |||
0 commit comments