Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LoggerFactory #224

Closed
lavrov opened this issue Sep 20, 2019 · 4 comments
Closed

Support LoggerFactory #224

lavrov opened this issue Sep 20, 2019 · 4 comments

Comments

@lavrov
Copy link
Contributor

lavrov commented Sep 20, 2019

Abstract LoggerFactory[F[_]] which would provide implementation agnostic factory methods. Having such factory would allow one to choose implementation at one place once.

@lorandszakacs
Copy link
Member

Agree that this would be useful. I am willing to bikeshed the naming though. Factory is way too java.

@sirmax
Copy link

sirmax commented Sep 21, 2019

Regarding the naming, how about Loggers[F[_]]? Its API can mimic that of Slf4jLogger

trait Loggers[F[_]] {
  def get: Logger[F]
  def getFromName(name: String): Logger[F]
  def getFromClass(clazz: Class[_]): Logger[F]

  def create: F[Logger[F]]
  def fromName(name: String): F[Logger[F]]
  def fromClass(clazz: Class[_]): F[Logger[F]]
}

As a side-note: perhaps, it would be pragmatic to return not a plain Logger[F] but a full-blown SelfAwareStructuredLogger[F].

@lorandszakacs lorandszakacs linked a pull request Apr 5, 2021 that will close this issue
4 tasks
@ivan-klass
Copy link
Contributor

Seems like #629 is related PR for this

@lorandszakacs
Copy link
Member

Available starting with 2.3.0 and 1.7.0 respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants