logback-android icon indicating copy to clipboard operation
logback-android copied to clipboard

LogcatAppender show errors for logs' "highlighting".

Open LSmyrnaios opened this issue 2 years ago • 0 comments

Describe the bug

Hi,

I have set the LogcatAppender as such:

<appender name="Logcat" class="ch.qos.logback.classic.android.LogcatAppender">
        <encoder>
            <charset>UTF-8</charset>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{36}.%M\(@%line\)) - %msg%n</pattern>
        </encoder>
    </appender>

Wehn running the app, I get the following errors:

I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - There is no conversion class registered for composite conversion word [highlight]
I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - Failed to create converter for [%highlight] keyword
I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - There is no conversion class registered for composite conversion word [cyan]
I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - Failed to create converter for [%cyan] keyword

When using the "ConsoleAppender", in non-android projects, with the aforementioned pattern, the logs get highlighted.

Could you please add support for logs-highlighting?

Thank you

Reproduction

Set the above pattern inside the LogcatAppender, run the app and check the Logcat output for errors.

Logs

I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - There is no conversion class registered for composite conversion word [highlight] I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - Failed to create converter for [%highlight] keyword I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - There is no conversion class registered for composite conversion word [cyan] I/System.out: 13:58:11,249 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@a052b99 - Failed to create converter for [%cyan] keyword

logback-android version

3.0.0

OS Version

Windows 10

What logback configuration are you using? (logback.xml or Java/Kotlin code)

logback.xml

Validations

  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

LSmyrnaios avatar Mar 28 '23 11:03 LSmyrnaios