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

Logger ignores data field #497

Closed
kamilkloch opened this issue Aug 1, 2023 · 3 comments
Closed

Logger ignores data field #497

kamilkloch opened this issue Aug 1, 2023 · 3 comments

Comments

@kamilkloch
Copy link

log.set("k2", "v2").info("From within foo")
println(log.set("k2", "v2").data.values.map(_.apply))

prints

[2023.08.01 23:00:23:540] INFO  [main] ScribeTests.foo:12 - From within foo ()
List(v2)
@darkfrog26
Copy link
Contributor

You're clearly using a custom Formatter that isn't including that. See this example:

object Test {
  def main(args: Array[String]): Unit = {
    val logger = Logger("testing")
    logger.set("testData", "This is a test data!").info("Testing first!")
    logger.info("Testing!")
  }
}

Outputs:
Screenshot from 2023-08-02 16-53-34

@kamilkloch
Copy link
Author

kamilkloch commented Aug 3, 2023

I am using the following formatter:

formatter"[$dateFull] $levelColoredPaddedRight [$threadName] ${green(positionSimple)} - $message$mdc"

I ran your snippet

object Test {
  def main(args: Array[String]): Unit = {
    val logger = scribe.Logger("testing")
    logger.set("testData", "This is a test data!").info("Testing first!")
    logger.info("Testing!")
  }
}

and get the following result:

2023.08.03 09:40:29:0000 main INFO com.superfund.exchange.research.kamilk.ScribeTests.main:46
    Testing first!
2023.08.03 09:40:29:0001 main INFO com.superfund.exchange.research.kamilk.ScribeTests.main:47
    Testing!

@kamilkloch
Copy link
Author

Did not work in v3.6.6. Started working after updating to 3.11.8. Thank you.

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

No branches or pull requests

2 participants