odin
odin copied to clipboard
Use `Option(t)` instead of `Some(t)`
When passing an exception to a log statement, it is not uncommon to pass in a null value, e.g., instead of
logger.error("oh no")
sometimes
logger.error("oh no", null)
is called.
In the DefaultLogger, the passed ToThrowable[E] is turned into an Option[Throwable].
In most Scala code the expectation is that for any val t: Option[T] either t == None or t == Some(x) for x != null. With this change we avoid creating a Some(null) value if the cause to be logged is null.