diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-04 08:46:40 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-04 08:49:50 -0800 |
commit | 305a987da0df292b75a16aae9c698df155af0a8c (patch) | |
tree | 3ed9bda291cec590c69d95eb0902e8444c25b9f8 /src/reflect | |
parent | 1bde987ee151d8898963ee503b1e6901226cabce (diff) | |
download | scala-305a987da0df292b75a16aae9c698df155af0a8c.tar.gz scala-305a987da0df292b75a16aae9c698df155af0a8c.tar.bz2 scala-305a987da0df292b75a16aae9c698df155af0a8c.zip |
Added methods debuglogResult and devWarningResult.
Lowering the barriers to sensible logging - these methods are
key in avoiding the "too much trouble" syndrome.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/SymbolTable.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/SymbolTable.scala b/src/reflect/scala/reflect/internal/SymbolTable.scala index 9b5778b9da..03ec59f0fe 100644 --- a/src/reflect/scala/reflect/internal/SymbolTable.scala +++ b/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) |