Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Closed
solatis opened this issue Jun 1, 2018 · 3 comments · Fixed by #3339
Closed

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

solatis opened this issue Jun 1, 2018 · 3 comments · Fixed by #3339
Assignees
Labels
api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@solatis
Copy link

solatis commented Jun 1, 2018

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.

@yihanzhen
Copy link
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)

@yihanzhen yihanzhen added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jun 1, 2018
@solatis
Copy link
Author

solatis commented Jun 2, 2018

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.

@yihanzhen
Copy link
Contributor

Oh sorry I missed that. Working on that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants