Class ColorConverter

java.lang.Object
ch.qos.logback.core.pattern.Converter<E>
ch.qos.logback.core.pattern.FormattingConverter<E>
ch.qos.logback.core.pattern.DynamicConverter<E>
ch.qos.logback.core.pattern.CompositeConverter<ch.qos.logback.classic.spi.ILoggingEvent>
org.springframework.boot.logging.logback.ColorConverter
All Implemented Interfaces:
ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle

public class ColorConverter extends ch.qos.logback.core.pattern.CompositeConverter<ch.qos.logback.classic.spi.ILoggingEvent>
Logback CompositeConverter colors output using the AnsiOutput class. A single 'color' option can be provided to the converter, or if not specified color will be picked based on the logging level.
Since:
1.0.0
Author:
Phillip Webb
  • Field Summary

    Fields inherited from class ch.qos.logback.core.pattern.DynamicConverter

    started
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
     
    protected String
    transform(ch.qos.logback.classic.spi.ILoggingEvent event, String in)
     

    Methods inherited from class ch.qos.logback.core.pattern.CompositeConverter

    convert, getChildConverter, setChildConverter, toString

    Methods inherited from class ch.qos.logback.core.pattern.DynamicConverter

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getFirstOption, getOptionList, isStarted, setContext, setOptionList, start, stop

    Methods inherited from class ch.qos.logback.core.pattern.FormattingConverter

    getFormattingInfo, setFormattingInfo, write

    Methods inherited from class ch.qos.logback.core.pattern.Converter

    getNext, setNext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ColorConverter

      public ColorConverter()
  • Method Details

    • transform

      protected String transform(ch.qos.logback.classic.spi.ILoggingEvent event, String in)
      Specified by:
      transform in class ch.qos.logback.core.pattern.CompositeConverter<ch.qos.logback.classic.spi.ILoggingEvent>
    • toAnsiString

      protected String toAnsiString(String in, AnsiElement element)