Adopt to new loggin api

This commit is contained in:
eikek
2022-02-19 14:00:47 +01:00
parent 6442771270
commit e483a97de7
130 changed files with 634 additions and 662 deletions

View File

@ -14,6 +14,7 @@ import fs2.Stream
import fs2.concurrent.{Topic => Fs2Topic}
import docspell.common._
import docspell.logging.Logger
import docspell.pubsub.api._
import docspell.pubsub.naive.NaivePubSub.State
import docspell.store.Store
@ -60,7 +61,7 @@ final class NaivePubSub[F[_]: Async](
store: Store[F],
client: Client[F]
) extends PubSub[F] {
private val logger: Logger[F] = Logger.log4s(org.log4s.getLogger)
private val logger: Logger[F] = docspell.logging.getLogger[F]
def withClient(client: Client[F]): NaivePubSub[F] =
new NaivePubSub[F](cfg, state, store, client)
@ -85,7 +86,7 @@ final class NaivePubSub[F[_]: Async](
def subscribe(topics: NonEmptyList[Topic]): Stream[F, Message[Json]] =
(for {
_ <- logger.s.info(s"Adding subscriber for topics: $topics")
_ <- logger.stream.info(s"Adding subscriber for topics: $topics")
_ <- Stream.resource[F, Unit](addRemote(topics))
m <- Stream.eval(addLocal(topics))
} yield m).flatten

View File

@ -9,6 +9,7 @@ package docspell.pubsub.naive
import cats.effect._
import docspell.common._
import docspell.logging.Logger
import docspell.pubsub.api._
import docspell.store.{Store, StoreFixture}
@ -45,7 +46,7 @@ trait Fixtures extends HttpClientOps { self: CatsEffectSuite =>
}
object Fixtures {
private val loggerIO: Logger[IO] = Logger.log4s(org.log4s.getLogger)
private val loggerIO: Logger[IO] = docspell.logging.getLogger[IO]
final case class Env(store: Store[IO], cfg: PubSubConfig) {
def pubSub: Resource[IO, NaivePubSub[IO]] = {

View File

@ -55,5 +55,5 @@ trait HttpClientOps {
}
object HttpClientOps {
private val logger: Logger[IO] = Logger.log4s(org.log4s.getLogger)
private val logger = docspell.logging.getLogger[IO]
}

View File

@ -12,14 +12,13 @@ import cats.effect._
import cats.implicits._
import fs2.concurrent.SignallingRef
import docspell.common._
import docspell.pubsub.api._
import docspell.pubsub.naive.Topics._
import munit.CatsEffectSuite
class NaivePubSubTest extends CatsEffectSuite with Fixtures {
private[this] val logger = Logger.log4s[IO](org.log4s.getLogger)
private[this] val logger = docspell.logging.getLogger[IO]
def subscribe[A](ps: PubSubT[IO], topic: TypedTopic[A]) =
for {