Commit 9f677885 authored by mokj's avatar mokj
Browse files

Made debug-logging optional

parent 77ecc2ec
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
lazy val commonSettings = Seq(
  organization := "com.kjetland",
  organizationName := "mbknor",
  version := "1.0.0-build-7-SNAPSHOT",
  version := "1.0.0-build-8-SNAPSHOT",
  scalaVersion := "2.11.8",
  publishMavenStyle := true,
  publishArtifact in Test := false,
@@ -14,6 +14,7 @@ lazy val commonSettings = Seq(
    else
      Some("releases"  at nexus + "thirdparty/")
  },
  credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
//  publishTo := {
//    val nexus = "https://oss.sonatype.org/"
//    if (isSnapshot.value)
+4 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind._
import com.fasterxml.jackson.databind.node.{ArrayNode, JsonNodeFactory, ObjectNode}
import org.slf4j.LoggerFactory

class JsonSchemaGenerator(rootObjectMapper: ObjectMapper) {
class JsonSchemaGenerator(rootObjectMapper: ObjectMapper, debug:Boolean = false) {

  import scala.collection.JavaConversions._

@@ -109,7 +109,9 @@ class JsonSchemaGenerator(rootObjectMapper: ObjectMapper) {

  class MyJsonFormatVisitorWrapper(objectMapper: ObjectMapper, level:Int = 0, val node: ObjectNode = JsonNodeFactory.instance.objectNode(), val definitionsHandler:DefinitionsHandler) extends JsonFormatVisitorWrapper with MySerializerProvider {

    def l(s: String): Unit = {
    def l(s: => String): Unit = {
      if (!debug) return

      var indent = ""
      for( i <- 0 until level) {
        indent = indent + "  "