Skip to content

Commit

Permalink
fix: Add flush() calls in samples (#1116)
Browse files Browse the repository at this point in the history
* fix: Add flush() calls in samples

* Add optional in comment

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
losalex and gcf-owl-bot[bot] committed Oct 1, 2022
1 parent c46fbfc commit 6d3cb5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public static void main(String... args) throws Exception {

// Writes the log entry asynchronously
logging.write(Collections.singleton(entry));

// Optional - flush any pending log entries just before Logging is closed
logging.flush();
}
System.out.printf("Logged: %s%n", textPayload);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public static void main(String[] args) throws Exception {
.setResource(MonitoredResource.newBuilder("global").build())
.build();

// Writes the log entry asynchronously
logging.write(Collections.singleton(entry));

// Optional - flush any pending log entries just before Logging is closed
logging.flush();
}
System.out.printf("Wrote to %s\n", logName);
}
Expand Down

0 comments on commit 6d3cb5b

Please sign in to comment.