-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement listLogs API and provide sample snippet (#602)
* feat: add listLogs and listLogsAsync to Logging Add listLogs API support to hand-written layer of google-cloud-logging. Add unit testing for the new listLogs API. Fixes #593 * feat: add listLogs snippet example Add a sample snippet to demonstrate use of listLogs API. Refactor ListLogs to include snippets for listLogs and listLogEntries. Format all snippets. Fixes #358. * chore: set generated serialVersionUID for LogNamePageFetcher * chore(code): fixing errors * chore(deps): fix clirr plugin 7012 error Because of JDK 1.7 it is impossible to provide default implementation for new interface methods. File with exclusions is added instead. The file should be removed once JDK version is upgraded. * chore(tests): fix samples' tests Fix printed string in LogEntryWriteHttpRequest.createLogEntryRequest(). Fix loops to wait for any data in STDOUT. Add test for listLogs snippet. * chore(test): forward exception throwing Update testListLogNames() signature to throw exceptions * chore(tests): refactoring tests Test ListLogs.printLogNames vs audit logs to save time. Restore retrieval of log entries in the wait loop to ensure printing to STDOUT * chore(tests): fine tune clirr exceptions Provide method level exception configuration in clirr-ignored-differences. Implement default methods for new methods in Logging and LoggingRpc interfaces. Following guidelines, remove serialVersionUID from LogNamePageFetcher. * chore: refactoring method naming and sample snippets Make more verbose naming for methods. Refactor testing after renaming interface method(s). Split ListLogs sample into two: ListLogEntries and ListLogs. * chore(fix): fix formatting * chore(comment): fix copyright year of the new file * chore(fix): restore sample filter to list log entries update the list log entries filter to bring results only for the last hour. * chore(fix): fix snippet-bot errors adding empty region tag logging_list_log_entries to ListLogs.java
- Loading branch information
Showing
11 changed files
with
398 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html --> | ||
<!-- added to resolve breaking changes until JDK will be upgraded to ≥1.8 --> | ||
<differences> | ||
<!-- Added methods to com.google.cloud.logging.Logging interface with implementation in LoggingImpl is always okay --> | ||
<difference> | ||
<differenceType>7012</differenceType> | ||
<className>com/google/cloud/logging/Logging</className> | ||
<method>* listLogs*(com.google.cloud.logging.Logging$ListOption[])</method> | ||
</difference> | ||
<!-- Added methods to com.google.cloud.logging.spi.v2.LoggingRpc interface with implementation in GrpcLoggingRpc is always okay --> | ||
<difference> | ||
<differenceType>7012</differenceType> | ||
<className>com/google/cloud/logging/spi/v2/LoggingRpc</className> | ||
<method>* listLogs(com.google.logging.v2.ListLogsRequest)</method> | ||
</difference> | ||
</differences> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.