Skip to content

Commit

Permalink
Merge pull request #244 from laserdisc-io/upgrades
Browse files Browse the repository at this point in the history
upgrades, typelevel log4s
  • Loading branch information
barryoneill authored Jun 24, 2021
2 parents 7a9248a + 1210a7c commit 9304897
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AWS release SDK minor versions constantly, so let's go weekly instead of the default ("@asap")
pullRequests.frequency = "@weekly"
pullRequests.frequency = "@monthly"


Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.laserdisc.mysql.binlog
import cats.effect.Sync
import cats.implicits._
import com.github.shyiko.mysql.binlog.BinaryLogClient
import io.chrisdavenport.log4cats.Logger
import org.typelevel.log4cats.Logger
import io.laserdisc.mysql.binlog.checkpoint.BinlogOffset
import io.laserdisc.mysql.binlog.config.BinLogConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package object database {
for {
ce <- ExecutionContexts.fixedThreadPool[F](32) // our connect EC
te <- Blocker[F] // our transaction EC
_ <- Resource.liftF(Sync[F].delay(Class.forName(config.driverClass)))
_ <- Resource.eval(Sync[F].delay(Class.forName(config.driverClass)))
xa <- HikariTransactor.newHikariTransactor[F](
config.driverClass,
config.connectionURL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cats.implicits._
import com.github.shyiko.mysql.binlog.BinaryLogClient
import com.github.shyiko.mysql.binlog.event.Event
import fs2.concurrent.Queue
import io.chrisdavenport.log4cats.Logger
import org.typelevel.log4cats.Logger

class MysSqlBinlogEventProcessor[F[_]: ConcurrentEffect: Logger](
binlogClient: BinaryLogClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.github.shyiko.mysql.binlog.event.{
EventType,
EventHeaderV4 => JEventHeaderV4
}
import io.chrisdavenport.log4cats.Logger
import org.typelevel.log4cats.Logger
import io.circe.Json
import io.laserdisc.mysql.binlog.event.EventMessage
import io.laserdisc.mysql.binlog.models._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import cats.effect.concurrent.Ref
import cats.effect.{ ConcurrentEffect, Sync }
import cats.implicits._
import com.github.shyiko.mysql.binlog.event.Event
import io.chrisdavenport.log4cats.Logger
import org.typelevel.log4cats.Logger
import io.laserdisc.mysql.binlog.event.EventMessage

package object stream {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import com.github.shyiko.mysql.binlog.event.{ EventHeaderV4, EventType }
import db.MySqlContainer
import doobie.hikari.HikariTransactor
import doobie.implicits._
import io.chrisdavenport.log4cats.SelfAwareStructuredLogger
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger
import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import cats.implicits._
import io.laserdisc.mysql.binlog.database
import org.scalatest.matchers.should.Matchers
Expand Down Expand Up @@ -49,7 +49,7 @@ class MysqlBinlogStreamTest
})

val s = for {
implicit0(logger: SelfAwareStructuredLogger[IO]) <-
implicit0(logger: Logger[IO]) <-
fs2.Stream.eval(
Slf4jLogger.fromName[IO]("application")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import com.github.shyiko.mysql.binlog.BinaryLogClient
import db.MySqlContainer
import doobie.hikari.HikariTransactor
import doobie.implicits._
import io.chrisdavenport.log4cats.SelfAwareStructuredLogger
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger
import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import io.laserdisc.mysql.binlog.database
import io.laserdisc.mysql.binlog.models.SchemaMetadata
import org.scalatest.matchers.should.Matchers
Expand Down Expand Up @@ -59,9 +59,8 @@ class PipesTest extends AnyWordSpec with Matchers with ForAllTestContainer with
val events = xaResource
.use { implicit xa =>
for {
implicit0(logger: SelfAwareStructuredLogger[IO]) <- Slf4jLogger
.fromName[IO]("testing")
schemaMetadata <- SchemaMetadata.buildSchemaMetadata("test")
implicit0(logger: Logger[IO]) <- Slf4jLogger.fromName[IO]("testing")
schemaMetadata <- SchemaMetadata.buildSchemaMetadata("test")
transactionState <- TransactionState
.createTransactionState[IO](schemaMetadata, client)
actions <- MysqlBinlogStream
Expand Down
6 changes: 3 additions & 3 deletions mysql-binlog-stream-examples/app/main/BinLogListener.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import ciris._
import ciris.refined._
import eu.timepit.refined.auto._
import eu.timepit.refined.types.string.TrimmedString
import io.chrisdavenport.log4cats.Logger
import io.chrisdavenport.log4cats.slf4j.Slf4jLogger
import org.typelevel.log4cats.Logger
import org.typelevel.log4cats.slf4j.Slf4jLogger
import io.laserdisc.mysql.binlog.config.BinLogConfig
import io.laserdisc.mysql.binlog.models.SchemaMetadata
import io.laserdisc.mysql.binlog.stream.{ streamEvents, MysqlBinlogStream, TransactionState }
Expand All @@ -25,7 +25,7 @@ object BinLogListener extends IOApp {
env("DB_URL").option,
env("DB_SCHEMA"),
env("USE_SSL").as[Boolean]
).mapN { case (host, port, user, password, url, schema, useSSL) =>
).parMapN { case (host, port, user, password, url, schema, useSSL) =>
BinLogConfig(
host,
port,
Expand Down
26 changes: 13 additions & 13 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import sbt._

object Dependencies {
val cirisVersion = "1.2.1"
val doobieVersion = "0.10.0"
val circeVersion = "0.13.0"
val catsVersion = "2.3.1"
val doobieVersion = "0.13.4"
val circeVersion = "0.14.1"
val catsVersion = "2.5.1"

val TestLib = Seq(
libraryDependencies ++= Seq(
"org.scalamock" %% "scalamock" % "5.1.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.3" % Test, // ApacheV2
"org.scalatest" %% "scalatest" % "3.2.9" % Test,
"com.dimafeng" %% "testcontainers-scala" % "0.39.5" % Test,
"org.testcontainers" % "mysql" % "1.15.3" % Test,
"org.testcontainers" % "testcontainers" % "1.15.3" % Test
Expand All @@ -21,17 +21,17 @@ object Dependencies {
libraryDependencies ++= Seq(
"is.cir" %% "ciris-enumeratum" % cirisVersion,
"is.cir" %% "ciris-refined" % cirisVersion,
"eu.timepit" %% "refined" % "0.9.20"
"eu.timepit" %% "refined" % "0.9.26"
)
)

val Logging = Seq(
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3", // logging
"ch.qos.logback" % "logback-core" % "1.2.3", // logging
"org.slf4j" % "jcl-over-slf4j" % "1.7.31",
"org.slf4j" % "jul-to-slf4j" % "1.7.31",
"io.chrisdavenport" %% "log4cats-slf4j" % "1.1.1"
"ch.qos.logback" % "logback-classic" % "1.2.3", // logging
"ch.qos.logback" % "logback-core" % "1.2.3", // logging
"org.slf4j" % "jcl-over-slf4j" % "1.7.31",
"org.slf4j" % "jul-to-slf4j" % "1.7.31",
"org.typelevel" %% "log4cats-slf4j" % "1.3.1"
)
)

Expand All @@ -41,7 +41,7 @@ object Dependencies {
"org.tpolecat" %% "doobie-hikari" % doobieVersion, // HikariCP transactor.
"org.tpolecat" %% "doobie-refined" % doobieVersion, // Postgres driver 42.1.4 + type mappings.
"org.tpolecat" %% "doobie-scalatest" % doobieVersion % Test, // Support for doobie scalatest
"mysql" % "mysql-connector-java" % "8.0.23",
"mysql" % "mysql-connector-java" % "8.0.25",
"com.github.shyiko" % "mysql-binlog-connector-java" % "0.21.0"
)
)
Expand All @@ -64,8 +64,8 @@ object Dependencies {
val XML = Seq(
libraryDependencies ++= Seq(
"javax.xml.bind" % "jaxb-api" % "2.3.1",
"com.sun.xml.bind" % "jaxb-impl" % "3.0.0",
"com.sun.xml.bind" % "jaxb-core" % "3.0.0",
"com.sun.xml.bind" % "jaxb-impl" % "3.0.1",
"com.sun.xml.bind" % "jaxb-core" % "3.0.1",
"javax.activation" % "activation" % "1.1.1"
)
)
Expand Down

0 comments on commit 9304897

Please sign in to comment.