Skip to content

Logging - no public API to create SourceLocation.Builder #3331

Description

@solatis

It appears there is no public API to create a new com.google.cloud.logging.SourceLocation.Builder object, thus I am unable to append this metadata to the log entries.

Expected API would be to have a public com.google.cloud.logging.SourceLocation.newBuilder() function, but this is not there.

Activity

  1. yihanzhen commented on Jun 1, 2018

    @yihanzhen
    Contributor

    Sounds reasonable.
    (While before the method is added, you should be able to use new SourceLocation.Builder() to create a builder. It is not optimized but should work, as is used in tests)

  2. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: loggingIssues related to the Cloud Logging API.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Jun 1, 2018
  3. solatis commented on Jun 2, 2018

    @solatis
    Author

    The problem is that the SourceLocation.Builder constructor is also private, as seen here:

    https://github.com/GoogleCloudPlatform/google-cloud-java/blob/89436180eb6dabd90bbc38c5600d00f5b262cc36/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/SourceLocation.java#L44-L47

    The reason this works in the tests is that they share the same package/namespace, but it doesn't work for others.

  4. yihanzhen commented on Jun 2, 2018

    @yihanzhen
    Contributor

    Oh sorry I missed that. Working on that soon.

  5. self-assigned this
    on Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions