Skip to content

Commit

Permalink
Added logging
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
  • Loading branch information
imalygin committed Nov 27, 2024
1 parent 1cece55 commit d34363b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ <T extends SelfSerializable> List<T> readObjectByChildIndex(int index, Supplier<
StringLeaf stringValue = getChild(index);
if (stringValue != null) {
try {
String label = stringValue.getLabel();
logger.info(STARTUP.getMarker(), "Reading object from string: {} for index {}", label, index);
SerializableDataInputStream in = new SerializableDataInputStream(
new ByteArrayInputStream(stringValue.getLabel().getBytes(StandardCharsets.UTF_8)));
new ByteArrayInputStream(label.getBytes(StandardCharsets.UTF_8)));
return in.readSerializableList(1024, false, factory);
} catch (IOException e) {
throw new RuntimeException(e);
Expand All @@ -226,7 +228,9 @@ <T extends SelfSerializable> void writeObjectByChildIndex(int index, List<T> lis
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
SerializableDataOutputStream out = new SerializableDataOutputStream(byteOut);
out.writeSerializableList(list, false, true);
setChild(index, new StringLeaf(byteOut.toString(StandardCharsets.UTF_8)));
String label = byteOut.toString(StandardCharsets.UTF_8);
logger.info(STARTUP.getMarker(), "Writing object to string: {} for index {}", label, index);
setChild(index, new StringLeaf(label));
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit d34363b

Please sign in to comment.