You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.append("Configuration loaded from /etc/app.conf")
515
+
.toLine());
516
+
517
+
builder.reset();
518
+
connection.write(builder
519
+
.timestamp("2024-01-15 10:30:49").append("")
520
+
.trace("[TRACE]").append("")
521
+
.append("Entering method processRequest()")
499
522
.toLine());
500
523
```
501
524
502
-
Output adapts automatically to the terminal theme - bright colors on dark backgrounds, normal colors on light backgrounds.
525
+
Output adapts automatically to the terminal theme - bright colors on dark backgrounds, normal colors on light backgrounds. Debug and trace use subdued colors (white/gray) to be less prominent than the colored log levels.
|`forHighlight()`| Bright white | Black | Emphasized text |
149
155
|`forMuted()`| Normal white | Normal black | Secondary text |
150
156
|`forTimestamp()`| Bright cyan | Normal cyan | Log timestamps |
151
157
|`forMessage()`| Bright magenta | Normal magenta | Highlighted messages |
152
158
159
+
Log level colors follow a prominence hierarchy: **ERROR > WARN > INFO > DEBUG > TRACE**
160
+
153
161
These methods ensure readable colors on any background. On dark themes, bright colors stand out. On light themes, normal intensity prevents eye strain.
154
162
155
163
### Example: Status Messages
@@ -275,15 +283,20 @@ String output = builder
275
283
276
284
### Semantic Color Methods
277
285
278
-
The builder provides theme-aware semantic colors:
286
+
The builder provides theme-aware semantic colors for log levels:
279
287
280
288
```java
281
289
ANSIBuilder builder =ANSIBuilder.builder(cap);
282
290
291
+
// Log level colors (most to least prominent)
283
292
builder.error("Error message"); // Red (bright on dark, normal on light)
0 commit comments