Git Product home page Git Product logo

Comments (4)

keithelder avatar keithelder commented on September 9, 2024

It is a factory so it is supposed to only create the instance once per type/category creation if I remember correctly. Creating the logger is expensive and isn't supposed to be recreated with each and every call.

from rocklib.logging.

killyosaur avatar killyosaur commented on September 9, 2024

That's all fine and good, but that call doesn't check that the instance has been disposed of if/when someone does use DI as something other than Singleton.

Alternatively, the decision to use scoped over a singleton or visa-versa should be left up to the developer (recommended usage can be placed in the documentation explaining why it may be a bad idea to not use a singleton, as it stands, there is no explanation that a new version of the logging class will be created when an existing version is disposed of)

from rocklib.logging.

bfriesen avatar bfriesen commented on September 9, 2024

Indeed it does not dispose of the logger instances in 1.x. We've addressed the issue in the 2.0 version, which has pre-releases published to nuget right now (we anticipate publishing the release version next week). Instead of LoggerFactory.GetInstance, version 2.0 has two methods: LoggerFactory.Create and LoggerFactory.GetCached. This is exactly your suggestion. 😄

from rocklib.logging.

killyosaur avatar killyosaur commented on September 9, 2024

that it is, thanks for the update!

from rocklib.logging.

Related Issues (10)

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.