Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-102

LoggerLayoutPattern fails tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • Code
    • None

    Description

      In LoggerLayoutPatternTest class, the testWarnLayout() method is commented out because it fails with the following message:

      1) testWarnLayout(LoggerLayoutPatternTest)
      Undefined index: log4php.LoggerPatternConverter.spaces
      /Users/cgrobmeier/Documents/Development/workspace/log4php-trunk/src/main/php/helpers/LoggerPatternConverter.php:131
      /Users/cgrobmeier/Documents/Development/workspace/log4php-trunk/src/main/php/helpers/LoggerPatternConverter.php:104
      /Users/cgrobmeier/Documents/Development/workspace/log4php-trunk/src/main/php/layouts/LoggerPatternLayout.php:216
      /Users/cgrobmeier/Documents/Development/workspace/log4php-trunk/src/test/php/layouts/LoggerLayoutPatternTest.php:45

      This seems to be related to using a global variable $GLOBALS['log4php.LoggerPatternConverter.spaces'] in LoggerPatternConverter::spacePad(). I am unsure why the global variable is not accessible in this test, but using a global variable seems the wrong approach here anyway.

      Attachments

        1. LoggerLayoutPatternTest.patch.txt
          4 kB
          Ivan Habunek
        2. LoggerPatternConverter.patch.quickfix.txt
          2 kB
          Ivan Habunek
        3. LoggerPatternConverter.patch.rewrite.txt
          2 kB
          Ivan Habunek

        Activity

          People

            Unassigned Unassigned
            juice Ivan Habunek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: