style: Rename append{Escaped => Json}String.
Change-Id: Ie77c964f211d5cfa89edaa21b3d458afcc4402c7
diff --git a/core/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/LogEntry.java b/core/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/LogEntry.java
index 5d4d9cf..2d08c29 100644
--- a/core/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/LogEntry.java
+++ b/core/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/LogEntry.java
@@ -81,7 +81,7 @@
if (file != null) {
b.append("\"file\":");
- appendEscapedString(b, file);
+ appendJsonString(b, file);
commaNeeded = true;
}
@@ -90,7 +90,7 @@
b.append(",");
}
b.append("\"line\":");
- appendEscapedString(b, line);
+ appendJsonString(b, line);
commaNeeded = true;
}
@@ -99,7 +99,7 @@
b.append(",");
}
b.append("\"function\":");
- appendEscapedString(b, function);
+ appendJsonString(b, function);
}
}
}
@@ -130,25 +130,25 @@
if (insertId != null) {
b.append("\"logging.googleapis.com/insertId\":");
- appendEscapedString(b, insertId);
+ appendJsonString(b, insertId);
b.append(",");
}
if (trace != null) {
b.append("\"logging.googleapis.com/trace\":");
- appendEscapedString(b, trace);
+ appendJsonString(b, trace);
b.append(",");
}
if (spanId != null) {
b.append("\"logging.googleapis.com/spanId\":");
- appendEscapedString(b, spanId);
+ appendJsonString(b, spanId);
b.append(",");
}
if (nestedDiagnosticContext != null && !nestedDiagnosticContext.isEmpty()) {
b.append("\"nestedDiagnosticContext\":");
- appendEscapedString(b, nestedDiagnosticContext);
+ appendJsonString(b, nestedDiagnosticContext);
b.append(",");
}
@@ -163,18 +163,18 @@
first = false;
}
- appendEscapedString(b, entry.getKey());
+ appendJsonString(b, entry.getKey());
b.append(":");
- appendEscapedString(b, entry.getValue());
+ appendJsonString(b, entry.getValue());
}
b.append("},");
}
for (var entry : mappedDiagnosticContext.entrySet()) {
- appendEscapedString(b, entry.getKey());
+ appendJsonString(b, entry.getKey());
b.append(":");
- appendEscapedString(b, entry.getValue());
+ appendJsonString(b, entry.getValue());
b.append(",");
}
@@ -182,7 +182,7 @@
var jsonObject = parameter.json().build();
jsonObject.forEach(
(key, value) -> {
- appendEscapedString(b, key);
+ appendJsonString(b, key);
b.append(":");
appendJsonObject(b, value);
b.append(",");
@@ -191,7 +191,7 @@
if (type != null) {
b.append("\"@type\":");
- appendEscapedString(b, type);
+ appendJsonString(b, type);
b.append(",");
}
@@ -202,10 +202,10 @@
}
b.append("\"message\":");
- appendEscapedString(b, message);
+ appendJsonString(b, message);
b.append(",\"severity\":");
- appendEscapedString(b, severity);
+ appendJsonString(b, severity);
b.append(",\"timestamp\":{");
timestamp.json(b);
@@ -236,7 +236,7 @@
} else {
first = false;
}
- appendEscapedString(b, entry.getKey());
+ appendJsonString(b, entry.getKey());
b.append(":");
appendJsonObject(b, entry.getValue());
}
@@ -244,7 +244,7 @@
break;
case STRING:
- appendEscapedString(b, ((JsonString) value).getString());
+ appendJsonString(b, ((JsonString) value).getString());
break;
case NUMBER:
@@ -265,7 +265,7 @@
}
}
- private static void appendEscapedString(StringBuilder b, String s) {
+ private static void appendJsonString(StringBuilder b, String s) {
b.append('"');
for (var i = 0; i < s.length(); i++) {