All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evolutiongaming.kafka.journal.LogOfFromAkka.scala Maven / Gradle / Ivy

The newest version!
package com.evolutiongaming.kafka.journal

import akka.actor.ActorSystem
import akka.event.LogSource
import cats.effect.Sync
import cats.syntax.all._
import com.evolutiongaming.catshelper.LogOf

object LogOfFromAkka {

  def apply[F[_] : Sync](system: ActorSystem): LogOf[F] = {

    def log[A: LogSource](source: A) = {
      for {
        log <- Sync[F].delay { akka.event.Logging(system, source) }
      } yield {
        LogFromAkka[F](log)
      }
    }

    new LogOf[F] {

      def apply(source: String) = log(source)

      def apply(source: Class[_]) = log(source)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy