Skip to content

Commit 79baac6

Browse files
bpcreechBen Creechgcf-owl-bot[bot]
authored
fix: Make LoggingHandler.logEntryFor extensible (#1021)
* feat: Make LoggingHandler.logEntryFor extensible * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Ben Creech <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8c9a218 commit 79baac6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public void publish(LogRecord record) {
306306
}
307307
LogEntry logEntry;
308308
try {
309-
logEntry = logEntryFor(record);
309+
logEntry = logEntryFor(record).build();
310310
} catch (Exception ex) {
311311
getErrorManager().error(null, ex, ErrorManager.FORMAT_FAILURE);
312312
return;
@@ -344,7 +344,7 @@ public void publish(LogRecord record) {
344344
return null;
345345
}
346346

347-
private LogEntry logEntryFor(LogRecord record) throws Exception {
347+
protected LogEntry.Builder logEntryFor(LogRecord record) throws Exception {
348348
String payload = getFormatter().format(record);
349349
Level level = record.getLevel();
350350
LogEntry.Builder builder =
@@ -361,7 +361,7 @@ private LogEntry logEntryFor(LogRecord record) throws Exception {
361361
for (LoggingEnhancer enhancer : enhancers) {
362362
enhancer.enhanceLogEntry(builder);
363363
}
364-
return builder.build();
364+
return builder;
365365
}
366366

367367
@Override

0 commit comments

Comments
 (0)