Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FakeStorageRpc/LocalStorageHelper: leads to logs about needing to call Builder#setApplicationName #1496

Open
glasser opened this issue Oct 23, 2024 · 0 comments
Assignees
Labels
api: storage Issues related to the googleapis/java-storage-nio API. priority: p3 Desirable enhancement or fix. May not be included in next release.

Comments

@glasser
Copy link

glasser commented Oct 23, 2024

Steps to reproduce

  1. Use LocalStorageHelper at all
  2. See log messages needing to call setApplicationName

Code example

Anything using LocalStorageHelper, eg

LocalStorageHelper.customOptions(true).getService().writer(...)

ends up running this code in FakeStorageRpc.java

  public com.google.api.services.storage.Storage getStorage() {
    HttpTransport transport = new FakeStorageRpcHttpTransport();
    HttpRequestInitializer httpRequestInitializer = request -> {};
    return new com.google.api.services.storage.Storage(
        transport, new GsonFactory(), httpRequestInitializer);
  }

This Storage constructor creates and then immediately uses a Storage.Builder, which means there's no place to call Builder#setApplicationName, leading to an unavoidable log.

Stack trace

The logged message is:

WARN  com.google.api.client.googleapis.services.AbstractGoogleClient  - Application name is not set. Call Builder#setApplicationName.
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage-nio API. label Oct 23, 2024
@JesseLovelace JesseLovelace self-assigned this Oct 24, 2024
@JesseLovelace JesseLovelace added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Oct 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api: storage Issues related to the googleapis/java-storage-nio API. priority: p3 Desirable enhancement or fix. May not be included in next release.
Projects
None yet
Development

No branches or pull requests

2 participants