Skip to content

Commit 339baa4

Browse files
committed
feat: support different formats for cached log lines
1 parent fbb8117 commit 339baa4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cloudnet-rest-module/src/main/java/eu/cloudnetservice/ext/modules/rest/v3/V3HttpHandlerNode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ public V3HttpHandlerNode(
226226
var lines = this.consoleLogAppender.cachedLogEntries().stream()
227227
.map(ILoggingEvent::getFormattedMessage)
228228
.toList();
229-
yield JsonResponse.builder().body(lines);
229+
yield JsonResponse.builder().body(Map.of("lines", lines));
230230
}
231-
case "ansi" -> JsonResponse.builder().body(this.consoleLogAppender.cachedLogEntries());
231+
case "ansi" -> JsonResponse.builder().body(Map.of("lines", this.consoleLogAppender.formattedCachedLogLines()));
232232
default -> ProblemDetail.builder()
233233
.type("console-invalid-formatting-type")
234234
.title("Console Invalid Formatting Type")

cloudnet-rest-module/src/main/resources/documentation/swagger.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,9 @@ paths:
743743
type: array
744744
items:
745745
type: string
746+
'400':
747+
description: If the requested format is not supported.
748+
$ref: '#/components/responses/Problem'
746749
'401':
747750
$ref: '#/components/responses/Problem'
748751
'403':

0 commit comments

Comments
 (0)