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

withMinimalLevel does not work properly with AsyncLogger #460

Open
iRevive opened this issue Jun 19, 2022 · 0 comments · May be fixed by #461
Open

withMinimalLevel does not work properly with AsyncLogger #460

iRevive opened this issue Jun 19, 2022 · 0 comments · May be fixed by #461

Comments

@iRevive
Copy link
Contributor

iRevive commented Jun 19, 2022

The following example prints nothing, unfortunately:

io.odin.consoleLogger[IO](minLevel = Level.Info).withAsync()
  .use { logger =>
    logger.withMinimalLevel(Level.Debug).debug("debug message")
  }

Scastie https://scastie.scala-lang.org/NI4CRSYwTpWyCVkfaFKWcw

withMinimalLevel creates a copy of the logger, but the background consumer references the original one https://github.com/valskalla/odin/blob/master/core/src/main/scala/io/odin/loggers/AsyncLogger.scala#L65.

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

Successfully merging a pull request may close this issue.

1 participant