Coder Social home page Coder Social logo

zio-slf4j's Introduction

zio-slf4j

Referentially transparent logging with slf4j

Don't forget to include an implementation of slf4j-api (such as logback) on your classpath.

libraryDependencies += "com.nequissimus" %% "zio-slf4j" % "0.4.1"

Usage

For a simple usage example, see sample.scala.

Scalaz

zio-slf4j's dependency on Scalaz is entirely optional. It will only be used if already available, and not brought in transitively.

If Scalaz is availble on the application's classpath, methods using Show can be used. Otherwise, log messages will need to be of type String.

zio-slf4j's People

Contributors

greenrd avatar mergify[bot] avatar nequissimus avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zio-slf4j's Issues

Howto in README.

Hi,

Can you show how to use the library in README? I did tried putting in the library and define App with Slf4jLogger, overwriting clazz and import scalaz's implicit for Show[String] but that still throws errors on def not found. Thanks for your help.

Mapped Diagnostic Context ?

Are there any plans to integrate MDC?

Because of the "classic" MDC implementation using thread locals not working very well in thread-shifting environments like ZIO (or pretty much anything else in Scalaland), having this enabled out of the box (i.e. without the user having to manually mess with fiber-locals or such) would be the killer feature for this library.

Improve documentation

I just took a quick look at this library but was unable to figure out what exactly it provides and how it is meant to be used from the README.md as well as the sample.scala.

How do I log?
Best-practices?
Trade-offs?
Gotchas?

IMHO and at the very least the sample.scala should contain a few comments to highlight what it's meant to express...

Could we get rid of Scalaz dependency?

I have an application with ZIO but don't want to add Scalaz to my dependencies. Any chance to get the logger just for String, and not require Scalaz.Show ?

How to provide the Logger to the env in v 0.1.8?

Hi,

I am trying out following your example. However, I am on Scala 2.11.X and I can only use v. 0.1.8. With that, I am getting:

Error:(213, 22) type mismatch;
found : scalaz.zio.ZIO[nequi.zio.logger.Logger with scalaz.zio.console.Console with scalaz.zio.clock.Clock,Nothing,Int]
required: scalaz.zio.ZIO[Environment,Nothing,Int]
(which expands to) scalaz.zio.ZIO[scalaz.zio.clock.Clock with scalaz.zio.console.Console with scalaz.zio.system.System with scalaz.zio.random.Random with scalaz.zio.blocking.Blocking,Nothing,Int]
program(arr).fold(_ => 0, _ => 1)

How do I provide Logger to the program? Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.