LoggingOptions.getDefaultInstance() always returns a new object #908
Labels
api: logging
Issues related to the googleapis/java-logging API.
next major: breaking change
this is a change that we should wait to bundle into the next major version
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
LoggingOptions.getDefaultInstance()
always returns a new object:This is very misleading, because the method name suggests it will return the same instance.
Consequences are that
Logging
instance is not shared among handlers etc. if we useLoggingOptions.getDefaultInstance()
to pass the options, without saving them to a variable.In fact, our codebase had
LoggingOptions.getDefaultInstance().service
in a few places, and a new client was always created as a result.The text was updated successfully, but these errors were encountered: