Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inject-server: Throw an UnsupportedOperationException when Deprecated…
…Logging#log is accessed Problem The `c.t.inject.server.DeprecatedLogging` trait was introduced to the Finatra inject TwitterServer trait in order to provide a backward-compatible shim layer for Finatra services as they may have been setting the util-logging Flags and complete removal of the util-logging Logging trait would have removed the Flag definitions which would cause servers to fail startup. The shim layer was provided such that the Flags would still be defined even though they do nothing. And the logger instance was redefined to be marked `@deprecated` as a signal to users that it should not be used. However, users still mistakenly use it since logging in a Finatra application can be confusing due to the prevalence of the JUL logging library, `util/util-logging` in the stack. The stack is slowly moving away from the JUL logging of `util/util-logging` and to the SLF4J-API but nonetheless it is too nuanced to be obvious to most users right away. Solution Make accessing the `log` instance throw an `UnsupportedOperationException`. This instance should not be used for logging and the `DeprecatedLogging` trait is slated for removal. Hopefully throwing the exception prevents new incorrect usages from being introduced such that we can continue to unwind the removal of the `DeprecatedLogging` trait. JIRA Issues: CSL-7374 Differential Revision: https://phabricator.twitter.biz/D854365
- Loading branch information