mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
✨ Support named style closing tags
This commit is contained in:
@@ -284,6 +284,7 @@ match logger.file_runtime_state() {
|
||||
- `TextFormatter` and `TextFormatterConfig` also include `style_markup = disabled | builtin | full` so callers can choose whether style markup is parsed and whether custom tags are active.
|
||||
- `target_style_markup` and `fields_style_markup` independently control whether `target` and `fields` are parsed for style markup.
|
||||
- `message` also supports lightweight inline style tags such as `<red>...</>`, `<b>...</>`, `<#ff0000>...</>`, and `<bg:#202020>...</>`.
|
||||
- Closing tags now support both the short form `</>` and named closing tags such as `</red>`, `</danger>`, and `</b>`.
|
||||
- Builtin semantic tags now include `<accent>`, `<info>`, `<success>`, `<warning>`, `<danger>`, and `<muted>`.
|
||||
- Runtime style-tag APIs now include `TextStyle`, `StyleTagRegistry`, `style_tag_registry()`, `default_style_tag_registry()`, `set_tag(...)`, and `define_alias(...)`.
|
||||
- Style-tag lookup priority is formatter-local `style_tags` > global style tag registry > builtin tags.
|
||||
|
||||
@@ -18,6 +18,7 @@ version 0.4.0
|
||||
- feat: support `sink.text_formatter.style_markup` in JSON config parsing and serialization
|
||||
- feat: add builtin semantic style tags such as `accent`, `info`, `success`, `warning`, `danger`, and `muted`
|
||||
- feat: add independent `target_style_markup` and `fields_style_markup` controls for `TextFormatter` and `TextFormatterConfig`
|
||||
- feat: support named closing tags like `</red>` alongside the existing short close `</>`
|
||||
|
||||
### Test
|
||||
|
||||
@@ -31,6 +32,7 @@ version 0.4.0
|
||||
- test: cover disabled markup mode, builtin-only mode, and config-driven `style_markup` behavior
|
||||
- test: cover builtin semantic tag rendering and confirm user overrides still take precedence
|
||||
- test: cover target and field markup rendering, plus config roundtrip for the new formatter markup scopes
|
||||
- test: cover named closing tags, mixed short/named closing, and unmatched named-close fallback behavior
|
||||
|
||||
### Example
|
||||
|
||||
@@ -41,7 +43,7 @@ version 0.4.0
|
||||
### Notes
|
||||
|
||||
- `Auto` currently uses a conservative rule: if `NO_COLOR` exists, ANSI is disabled; otherwise ANSI is enabled
|
||||
- inline style markup currently supports short close `</>` only
|
||||
- inline style markup supports both short close `</>` and named closing tags like `</red>`
|
||||
- unknown or invalid inline tags currently fall back to plain text and do not raise formatter errors
|
||||
- formatter-local tag lookup currently takes precedence over global tag lookup, and global lookup takes precedence over builtin tags
|
||||
- JSON config currently supports concrete style objects only; alias-style declarations remain runtime-only
|
||||
|
||||
Reference in New Issue
Block a user