From f56e2d27df1beab0d8c694fa0b2ea85df9af19a7 Mon Sep 17 00:00:00 2001 From: Dean Chapman Date: Wed, 16 May 2018 16:06:12 +0100 Subject: [PATCH] Add convenience Revolver.disableDebugging method to complement Revolver.enableDebugging --- README.md | 4 ++++ src/main/scala/spray/revolver/RevolverPlugin.scala | 3 +++ src/sbt-test/sbt-revolver/env-vars/test | 1 + 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 6895469..9501d1e 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,10 @@ To enable debugging with the specified options: Revolver.enableDebugging(port = 5050, suspend = true) +To disable debugging: + + Revolver.disableDebugging + To change set of colors used to tag output from multiple processes: reColors := Seq("blue", "green", "magenta") diff --git a/src/main/scala/spray/revolver/RevolverPlugin.scala b/src/main/scala/spray/revolver/RevolverPlugin.scala index cede183..1b9125c 100644 --- a/src/main/scala/spray/revolver/RevolverPlugin.scala +++ b/src/main/scala/spray/revolver/RevolverPlugin.scala @@ -29,6 +29,9 @@ object RevolverPlugin extends AutoPlugin { def enableDebugging(port: Int = 5005, suspend: Boolean = false) = debugSettings in reStart := Some(DebugSettings(port, suspend)) + def disableDebugging = + debugSettings in reStart := None + def noColors: Seq[String] = Nil def basicColors = Seq("BLUE", "MAGENTA", "CYAN", "YELLOW", "GREEN") def basicColorsAndUnderlined = basicColors ++ basicColors.map("_"+_) diff --git a/src/sbt-test/sbt-revolver/env-vars/test b/src/sbt-test/sbt-revolver/env-vars/test index e417e55..e5d296d 100644 --- a/src/sbt-test/sbt-revolver/env-vars/test +++ b/src/sbt-test/sbt-revolver/env-vars/test @@ -1,3 +1,4 @@ +> set Revolver.disableDebugging > reStart $ sleep 2000 $ exec curl http://0.0.0.0:8888