Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added methods debuglogResult and devWarningResult.

Lowering the barriers to sensible logging - these methods are
key in avoiding the "too much trouble" syndrome.
  • Loading branch information...
commit 305a987da0df292b75a16aae9c698df155af0a8c 1 parent 1bde987
@paulp paulp authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/reflect/scala/reflect/internal/SymbolTable.scala
View
10 src/reflect/scala/reflect/internal/SymbolTable.scala
@@ -87,6 +87,16 @@ abstract class SymbolTable extends macros.Universe
result
}
@inline
+ final private[scala] def debuglogResult[T](msg: => String)(result: T): T = {
+ debuglog(msg + ": " + result)
+ result
+ }
+ @inline
+ final private[scala] def devWarningResult[T](msg: => String)(result: T): T = {
+ devWarning(msg + ": " + result)
+ result
+ }
+ @inline
final private[scala] def logResultIf[T](msg: => String, cond: T => Boolean)(result: T): T = {
if (cond(result))
log(msg + ": " + result)
Please sign in to comment.
Something went wrong with that request. Please try again.