mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Adopt to new loggin api
This commit is contained in:
@ -9,7 +9,7 @@ package docspell.notification.impl
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common._
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api._
|
||||
|
||||
import emil.Emil
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
package docspell.notification.impl
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api.EventContext
|
||||
|
||||
import io.circe.Json
|
||||
|
@ -10,7 +10,6 @@ import cats.data.Kleisli
|
||||
import cats.data.OptionT
|
||||
import cats.effect._
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.notification.api.Event
|
||||
import docspell.notification.api.NotificationBackend
|
||||
import docspell.store.Store
|
||||
@ -21,13 +20,13 @@ import org.http4s.client.Client
|
||||
|
||||
/** Represents the actual work done for each event. */
|
||||
object EventNotify {
|
||||
private[this] val log4sLogger = org.log4s.getLogger
|
||||
|
||||
def apply[F[_]: Async](
|
||||
store: Store[F],
|
||||
mailService: Emil[F],
|
||||
client: Client[F]
|
||||
): Kleisli[F, Event, Unit] =
|
||||
): Kleisli[F, Event, Unit] = {
|
||||
val logger = docspell.logging.getLogger[F]
|
||||
Kleisli { event =>
|
||||
(for {
|
||||
hooks <- OptionT.liftF(store.transact(QNotification.findChannelsForEvent(event)))
|
||||
@ -43,10 +42,11 @@ object EventNotify {
|
||||
NotificationBackendImpl.forChannelsIgnoreErrors(
|
||||
client,
|
||||
mailService,
|
||||
Logger.log4s(log4sLogger)
|
||||
logger
|
||||
)(channels)
|
||||
_ <- OptionT.liftF(backend.send(evctx))
|
||||
} yield ()).getOrElse(())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ package docspell.notification.impl
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api._
|
||||
|
||||
import io.circe.Json
|
||||
|
@ -9,7 +9,7 @@ package docspell.notification.impl
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api._
|
||||
|
||||
import org.http4s.Uri
|
||||
|
@ -9,7 +9,7 @@ package docspell.notification.impl
|
||||
import cats.effect._
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common._
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api.NotificationChannel
|
||||
|
||||
import org.http4s.Request
|
||||
|
@ -8,7 +8,7 @@ package docspell.notification.impl
|
||||
|
||||
import cats.effect._
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api._
|
||||
|
||||
import org.http4s.Uri
|
||||
|
@ -9,7 +9,7 @@ package docspell.notification.impl
|
||||
import cats.data.NonEmptyList
|
||||
import cats.effect._
|
||||
|
||||
import docspell.common.Logger
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api.NotificationBackend.{combineAll, ignoreErrors, silent}
|
||||
import docspell.notification.api.{NotificationBackend, NotificationChannel}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import cats.data.Kleisli
|
||||
import cats.effect.kernel.Async
|
||||
import cats.implicits._
|
||||
|
||||
import docspell.common._
|
||||
import docspell.logging.Logger
|
||||
import docspell.notification.api._
|
||||
import docspell.store.Store
|
||||
|
||||
|
Reference in New Issue
Block a user