Skip to content

Commit

Permalink
added log subsystem, logging to DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
jpzk committed Oct 29, 2019
1 parent e6a75b7 commit 4088f71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.6

* added logging subsystem, log to DEBUG

# 1.5

* added input fields txid, vout, scriptSig for TransactionResponse inputs
Expand Down
10 changes: 8 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lazy val commonSettings = Seq(
organization := "io.tokenanalyst",
version := "1.5.0",
version := "1.6.0",
scalaVersion := "2.12.10",
description := "bitcoin-rpc")

Expand All @@ -12,7 +12,7 @@ lazy val bitcoinrpc = (project in file(".")).
publishTo := Some(Resolver.url("TA-S3", url("s3://ivy-jar-repository-ta/"))(Resolver.ivyStylePatterns))
).
settings(
libraryDependencies ++= http4s ++ json ++ zmq
libraryDependencies ++= http4s ++ json ++ zmq ++ log
)

val workaround = {
Expand All @@ -34,6 +34,12 @@ lazy val json = Seq(
"io.circe" %% "circe-literal" % "0.11.1"
)

lazy val log = Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3",
"net.logstash.logback" % "logstash-logback-encoder" % "4.11",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0"
)

lazy val zmq = Seq (
"org.zeromq" % "jeromq" % "0.5.1"
)
6 changes: 4 additions & 2 deletions src/main/scala/BitcoinRPC.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import io.circe.generic.auto._
import cats.effect.{IO, ContextShift, Resource}
import cats.effect.ContextShift

import com.typesafe.scalalogging.LazyLogging

import Protocol._

import scala.concurrent.ExecutionContext
Expand All @@ -45,7 +47,7 @@ case class Config(
zmqPort: Option[Int] = None
)

object BitcoinRPC extends Http4sClientDsl[IO] with Calls {
object BitcoinRPC extends Http4sClientDsl[IO] with Calls with LazyLogging {

def openAll()(
implicit config: Config,
Expand Down Expand Up @@ -90,7 +92,7 @@ object BitcoinRPC extends Http4sClientDsl[IO] with Calls {
Accept(MediaType.application.json)
)
)
_ <- Right(println(request.asJson))
_ <- Right(logger.debug(request.asJson.toString()))
} yield p)
.getOrElse(throw new Exception("No proper exception handling yet"))
}
Expand Down

0 comments on commit 4088f71

Please sign in to comment.