Skip to content

oleg-py/iolog4s

 
 

Repository files navigation

iolog4s

Maven Central Sonatype Scala Scala


See docs

Avaialble for scala versions 2.11, and 2.12. SBT artifacts:

"iolog4s.org" %% "iolog4s" % "0.0.1"

about

iolog4s is a logging library for scala that suspends all your logging side-effects into your chosen cats.effect.Sync instance, e.g.:

iolog4s has the same interface as log4s, except all return types are of type F[Unit] where F[_]: Sync.

on implementation and copyright

The vast majority of the development effort goes to the authors of log4s, as the code here is mostly altered versions of their macros. So please extend all your thanks to them! It also means that you can expect the same reliability.

example

object Main extends App {
  import org.iolog4s._
  import cats.effect.IO

  val logger: Logger[IO] = Logger.create[IO]

  val logs: IO[Unit] = for {
    _ <- logger.trace("test-trace")
    _ <- logger.debug("test-debug")
    _ <- logger.info("test-info")
    _ <- logger.warn("test-warn")
    _ <- logger.error("test-error")

  } yield ()

  logs.unsafeRunSync()

}

what is to be done?

Support for MDC is still under development, stay tuned.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 99.2%
  • Shell 0.8%