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

Fix logging of raw strings #7548

Merged
merged 2 commits into from
May 5, 2024
Merged

Commits on May 2, 2024

  1. Fix logging of raw strings

    sbt passes raw string messages in `ConsoleAppenderFromLog4J` to `StringFormatterMessageFactory`. This is wrong because these strings are pre-formatted and should not be processed again for formatting. There is no way to pass parameters to them anyway. This causes problems when the raw strings contain characters that `StringFormatterMessageFactory` wants to interpret.
    
    For example, when using `-Ystatistics`:
    
    ```
    ERROR StatusConsoleListener Unable to format msg:   nscprofiling                : 1 spans, ()7.543ms (0.3%)
    java.util.UnknownFormatConversionException: Conversion = ')'
    at java.base/java.util.Formatter.checkText(Formatter.java:2732)
    at java.base/java.util.Formatter.parse(Formatter.java:2718)
    at java.base/java.util.Formatter.format(Formatter.java:2655)
    at java.base/java.util.Formatter.format(Formatter.java:2609)
    at java.base/java.lang.String.format(String.java:2938)
    at org.apache.logging.log4j.message.StringFormattedMessage.formatMessage(StringFormattedMessage.java:121)
    at org.apache.logging.log4j.message.StringFormattedMessage.getFormattedMessage(StringFormattedMessage.java:89)
    at sbt.internal.util.Appender.$anonfun$appendMessage$1(ConsoleAppender.scala:522)
    ...
    ```
    szeiger committed May 2, 2024
    Configuration menu
    Copy the full SHA
    da79479 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2024

  1. Configuration menu
    Copy the full SHA
    26cdfa8 View commit details
    Browse the repository at this point in the history