Giter Site home page Giter Site logo

Custom logger about scala-logging HOT 4 OPEN

lightbend-labs avatar lightbend-labs commented on August 23, 2024 3
Custom logger

from scala-logging.

Comments (4)

analytically avatar analytically commented on August 23, 2024

Can you explain your use case for a custom logger?

from scala-logging.

LMnet avatar LMnet commented on August 23, 2024

In my project in some classes I need to wrap all logger calls with MDC.put and MDC.remove calls. It would be cool if I will have a possibility to add this boilerplate calls inside custom logger.

from scala-logging.

zatekusen avatar zatekusen commented on August 23, 2024

We have a similar situation in our project. We have a custom ThrottledLogger extends Logger - the old trait which is available in version 2.1.2.
All classes use that trait and we can choose to supply normal or throttled logger.

Now that trait has gone in the latest version, there is no common trait to use unless we hand crank our own version.

from scala-logging.

analytically avatar analytically commented on August 23, 2024

Via Patrick Premont: I think this wouldn’t help those who want to override the macros. They would need to ensure their subclass is used explicitly everywhere. Any reference to the base class would not get the overridden behaviour. So it would be safer for their type not to extend Logger, to avoid such accidents. I created a gist to highlight the compile-time dispatch that occurs with the macro override: https://gist.github.com/patrick-premont/01c5847958e1776d7748bb9570ee376e

from scala-logging.

Related Issues (20)

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.