Skip to content

Commit

Permalink
chore: add Debug.scala (zio#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath authored Jul 5, 2022
1 parent 753f2f0 commit 06a1f64
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sbt.librarymanagement.ScalaArtifacts.isScala3
val releaseDrafterVersion = "5"

// Setting default log level to INFO
val _ = sys.props += ("ZHttpLogLevel" -> ZHttpLogLevel)
val _ = sys.props += ("ZHttpLogLevel" -> Debug.ZHttpLogLevel)

// CI Configuration
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.graalvm("21.1.0", "11"), JavaSpec.temurin("8"))
Expand Down Expand Up @@ -139,6 +139,6 @@ lazy val zhttpLogging = (project in file("zio-http-logging"))
lazy val example = (project in file("./example"))
.settings(stdSettings("example"))
.settings(publishSetting(false))
.settings(runSettings("example.HelloWorld"))
.settings(runSettings(Debug.Main))
.settings(libraryDependencies ++= Seq(`jwt-core`))
.dependsOn(zhttp)
4 changes: 1 addition & 3 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ object BuildHelper extends ScalaSettings {
val ScoverageVersion = "1.9.3"
val JmhVersion = "0.4.3"

val ZHttpLogLevel = "INFO"

private val stdOptions = Seq(
"-deprecation",
"-encoding",
Expand Down Expand Up @@ -66,7 +64,7 @@ object BuildHelper extends ScalaSettings {
Test / parallelExecution := true,
incOptions ~= (_.withLogRecompileOnMacro(false)),
autoAPIMappings := true,
ThisBuild / javaOptions := Seq("-Dio.netty.leakDetectionLevel=paranoid", s"-DZHttpLogLevel=${ZHttpLogLevel}"),
ThisBuild / javaOptions := Seq("-Dio.netty.leakDetectionLevel=paranoid", s"-DZHttpLogLevel=${Debug.ZHttpLogLevel}"),
ThisBuild / fork := true,
)

Expand Down
20 changes: 20 additions & 0 deletions project/Debug.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Contains a list of configurations to play around with while debugging the
* internals of ZIO Http.
*/
object Debug {

/**
* Sets the global log level for ZIO Http. NOTE: A clean build will be
* required once this is changed. After which you can run the compiler in
* watch mode.
*
* Possible Values: DEBUG, ERROR, INFO, TRACE, WARN
*/
val ZHttpLogLevel = "INFO"

/**
* Sets the main application to execute in the example project.
*/
val Main = "example.WebSocketAdvanced"
}

0 comments on commit 06a1f64

Please sign in to comment.