summaryrefslogtreecommitdiff
path: root/core/src/main/java
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2024-07-03 20:16:34 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2024-07-03 20:16:34 +0200
commita33e7ff53aab2d6555f06a5f8ef6e4db0888764e (patch)
tree5f1cd3629264ca3d49e1d5ba512934df9dacee44 /core/src/main/java
parentf55538335f0dc61ca4988685fb394123bcc0b68e (diff)
style: Rename append{Escaped => Json}String.
Change-Id: Ie77c964f211d5cfa89edaa21b3d458afcc4402c7
Diffstat (limited to 'core/src/main/java')
-rw-r--r--core/src/main/java/eu/mulk/quarkus/googlecloud/jsonlogging/LogEntry.java36
1 files changed, 18 insertions, 18 deletions
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 @@ final class LogEntry {
if (file != null) {
b.append("\"file\":");
- appendEscapedString(b, file);
+ appendJsonString(b, file);
commaNeeded = true;
}
@@ -90,7 +90,7 @@ final class LogEntry {
b.append(",");
}
b.append("\"line\":");
- appendEscapedString(b, line);
+ appendJsonString(b, line);
commaNeeded = true;
}
@@ -99,7 +99,7 @@ final class LogEntry {
b.append(",");
}
b.append("\"function\":");
- appendEscapedString(b, function);
+ appendJsonString(b, function);
}
}
}
@@ -130,25 +130,25 @@ final class LogEntry {
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 @@ final class LogEntry {
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 @@ final class LogEntry {
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 @@ final class LogEntry {
if (type != null) {
b.append("\"@type\":");
- appendEscapedString(b, type);
+ appendJsonString(b, type);
b.append(",");
}
@@ -202,10 +202,10 @@ final class LogEntry {
}
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 @@ final class LogEntry {
} else {
first = false;
}
- appendEscapedString(b, entry.getKey());
+ appendJsonString(b, entry.getKey());
b.append(":");
appendJsonObject(b, entry.getValue());
}
@@ -244,7 +244,7 @@ final class LogEntry {
break;
case STRING:
- appendEscapedString(b, ((JsonString) value).getString());
+ appendJsonString(b, ((JsonString) value).getString());
break;
case NUMBER:
@@ -265,7 +265,7 @@ final class LogEntry {
}
}
- 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++) {