Skip to content

Commit

Permalink
util-logging: add missing type ascription to Logger's apply method
Browse files Browse the repository at this point in the history
Add missing `_*` to fix potential `java.util.UnknownFormatConversionException`
if the log message string contains printf-like things.

Signed-off-by: Bryce Anderson <banderson@twitter.com>

JIRA Issues: CSL-9356

Differential Revision: https://phabricator.twitter.biz/D430122
  • Loading branch information
mtkp authored and jenkins committed Feb 5, 2020
1 parent d8cc723 commit c875d35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -13,6 +13,11 @@ Breaking API Changes
* util-core: `Future.unapply` has been removed. Use `Future.poll` to retrieve Future's
state. ``PHAB_ID=D427429``

Bug Fixes
~~~~~~~~~

* util-logging: Add a missing `_*` that could result in exceptions when using the
`Logger.apply(Level, Throwable, String, Any*)` signature. ``PHAB_ID=D430122``

20.1.0
------
Expand Down
Expand Up @@ -83,7 +83,7 @@ class Logger protected (val name: String, private val wrapped: javalog.Logger) {
final def apply(level: Level, message: String, items: Any*): Unit = log(level, message, items: _*)

final def apply(level: Level, thrown: Throwable, message: String, items: Any*): Unit =
log(level, thrown, message, items)
log(level, thrown, message, items: _*)

// convenience methods:
@varargs
Expand Down
Expand Up @@ -205,7 +205,9 @@ class LoggerTest extends WordSpec with TempFolder with BeforeAndAfter {
"log & trace a message with percent signs" in {
traceLogger(Level.INFO)
Logger.get("")(Level.INFO, "%i")
Logger.get("")(Level.INFO, new Exception(), "%j")
mustLog("%i")
mustLog("%j")
}

"log a message, with timestamp" in {
Expand Down

0 comments on commit c875d35

Please sign in to comment.