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

can not call logger.info("the number is {}", 1) #34

Open
giabao opened this issue Oct 10, 2013 · 1 comment
Open

can not call logger.info("the number is {}", 1) #34

giabao opened this issue Oct 10, 2013 · 1 comment

Comments

@giabao
Copy link

giabao commented Oct 10, 2013

similar to all log level (error, warn,..).

Logger#info:

def info(message: String, params: AnyRef*): Unit = macro LoggerMacros.infoMessageParams

I think we must change params: AnyRef* to params: Any*

And in LoggerMacros#infoMessageParams: params: c.Expr[AnyRef]* to c.Expr[Any]*

In LoggerMacros#logParams:

  • Change params: Seq[c.Expr[AnyRef]] to Seq[c.Expr[Any]]
  • Then check if we need to convert params to type Seq[AnyRef] before delegate to underlying using WILDCARD_STAR syntax. See method akka.event.Logging#format1
@shanloid
Copy link

Just hit this issue after switching from vanilla slf4j to scala-logging (2.1.2, using Scala 2.10) in order to avoid #16

I'm surprised that this isn't affecting more people - it affects my project all over the place. Does no one else log things like numbers? Short of the change suggested above by giabao, is my only option to explicitly box any numbers that are headed to a logger? That's pretty ugly :(

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