Re #9: Cleanup.

This commit is contained in:
tomasz.kowalczewski committed 2020-12-26 18:01:14 +01:00
1 parent cdc1cf3ead
commit e96f28fb79
1 file changed
+24 -2
@@ -30,6 +30,30 @@ public class TjahziLogger {
);
int claim = logBuffer.tryClaim(LOG_MESSAGE_TYPE_ID, requiredSize);
if (claim > 0) {
putMessageOnRing(
timestamp,
labels,
logLevelLabel,
logLevel,
line,
claim
);
} else {
// TODO: increment dropped lines metric
}
return this;
}
private void putMessageOnRing(
long timestamp,
Map<String, String> labels,
String logLevelLabel,
String logLevel,
ByteBuffer line,
int claim
) {
try {
serializer
.writeTo(
@@ -45,7 +69,5 @@ public class TjahziLogger {
} catch (Throwable t) {
logBuffer.abort(claim);
}
return this;
}
}