Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-676

Logback does not pass turkey test

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      import java.io.Serializable;
      import java.util.ArrayList;
      import java.util.List;

      public class Bean implements Serializable {

      private static final long serialVersionUID = 1957667958813006175L;

      private List<String> iceCreams = new ArrayList<String>();

      public void addIceCream(String iceCream)

      { iceCreams.add(iceCream); }

      @Override
      public String toString()

      { return iceCreams.toString(); }

      }

      ////

      import java.beans.Introspector;
      import java.util.Locale;

      import org.slf4j.LoggerFactory;

      import ch.qos.logback.classic.Level;
      import ch.qos.logback.classic.Logger;
      import ch.qos.logback.classic.html.HTMLLayout;
      import ch.qos.logback.classic.spi.ILoggingEvent;
      import ch.qos.logback.classic.spi.LoggingEvent;
      import ch.qos.logback.core.ContextBase;
      import ch.qos.logback.core.joran.util.PropertySetter;

      public class Main {

      public static void main(String[] args)

      { Bean bean = new Bean(); PropertySetter setter = new PropertySetter(bean); setter.setContext(new ContextBase()); String propertyName = "iceCream"; setter.addBasicProperty(propertyName, "vanilla"); System.out.println(bean); System.out.println(propertyName.toUpperCase()); Locale.setDefault(new Locale("tr", "", "")); setter.addBasicProperty(propertyName, "chocolate"); System.out.println(bean); System.out.println(propertyName.toUpperCase()); System.out.println(Introspector.decapitalize("IceCream")); System.out.println("I".toLowerCase() + "ceCream"); System.out.println(capitalizeFirstLetter(propertyName)); System.out.println("i".toUpperCase() + "ceCream"); Logger logger = (Logger) LoggerFactory.getLogger("iAmALogger"); Level level = Level.INFO; ILoggingEvent event = new LoggingEvent("iAmALoggingEvent", logger, level, "i am logging", null, null); System.out.println(event); HTMLLayout layout = new HTMLLayout(); String html = layout.doLayout(event); System.out.println(html); }

      public static String capitalizeFirstLetter(String name) {
      if (name == null || name.length() == 0)

      { return name; }

      char chars[] = name.toCharArray();
      chars[0] = Character.toUpperCase(chars[0]);
      return new String(chars);
      }
      }

      @@ Output @@

      [vanilla]
      ICECREAM
      [vanilla]
      İCECREAM
      iceCream
      ıceCream
      IceCream
      İceCream
      [INFO] i am logging

      <tr class="ınfo even">
      </tr>

      @@@@

      http://www.codinghorror.com/blog/2008/03/whats-wrong-with-turkey.html

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              sdavids Sebastian Davids
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: