Skip to content

Commit

Permalink
hides logging behind an option
Browse files Browse the repository at this point in the history
  • Loading branch information
xeno-by committed Aug 31, 2013
1 parent db3ade9 commit 3410f7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ class Plugin(val global: Global) extends NscPlugin {
override def processOptions(options: List[String], error: String => Unit) {
options foreach {
case "-Yquasiquote-debug" => Settings.Yquasiquotedebug.value = true
case "-Ydebug" => Settings.Ydebug.value = true
case option => error("Option not understood: " + option)
}
}

override val optionsHelp: Option[String] = Some("""
| -P:macroparadise:
| -Yquasiquote-debug Trace quasiquote-related activities.
| -Ydebug Trace other random things.
""".trim.stripMargin)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ object Settings {
)

def Yquasiquotedebug = boolSetting("quasiquote.debug")
def Ydebug = boolSetting("debug")
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ trait Analyzer extends NscAnalyzer
paradiseDefinitions.init()
fastTrack.hijack()
} else {
val part1 = "Macro paradise plugin couldn't initialize the quasiquoting module"
val part2 = "Lodge an issue at https://github.com/scalamacros/paradise/issues if this is a problem for you"
Console.err.println(s"$part1. $part2")
if (settings.Ydebug.value) {
val part1 = "Macro paradise plugin couldn't initialize the quasiquoting module (haveScalaReflect = $haveScalaReflect, compilingScalaReflect = $compilingScalaReflect)"
val part2 = "Lodge an issue at https://github.com/scalamacros/paradise/issues if this is a problem for you"
Console.err.println(s"$part1. $part2")
}
}
}
}

0 comments on commit 3410f7d

Please sign in to comment.