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

unexpected expression evaluation #645

Closed
gfrison opened this issue Oct 24, 2024 · 3 comments
Closed

unexpected expression evaluation #645

gfrison opened this issue Oct 24, 2024 · 3 comments
Assignees
Labels

Comments

@gfrison
Copy link

gfrison commented Oct 24, 2024

Hello!

The example below shows that a trace log is evaluated even if the level (debug) should not allow that.

sbt: 1.10.3
scala: 3.5.2
scribe: 3.15.1

import org.scalatest.freespec.AsyncFreeSpec
import cats.effect.testing.scalatest.AsyncIOSpec
import org.scalatest.matchers.should.Matchers
import scribe.*

class ScribeTest extends AsyncFreeSpec with AsyncIOSpec with Matchers:
  Logger.root.withMinimumLevel(Level.Debug).replace()
  "scribe" in:
    trace {
      println("no good")
      "trace log"
    }
    "a" should be("a")

output:

testOnly *Scribe*
no good
[info] ScribeTest:
[info] - scribe
@darkfrog26 darkfrog26 self-assigned this Oct 25, 2024
@darkfrog26 darkfrog26 added the bug label Oct 25, 2024
@darkfrog26
Copy link
Contributor

If you do:

scribe.info(LogFeature.logOutput2LoggableMessage {
        throw new RuntimeException("Should not evaluate!")
        "testing"
      })

It works as it should. There's a problem with a change I made for varargs on LogFeatures apparently.

@darkfrog26
Copy link
Contributor

See release 3.15.2

@gfrison
Copy link
Author

gfrison commented Oct 25, 2024

great! Thank you!

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

No branches or pull requests

2 participants