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

Move common appender methods to parent class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0
    • 2.2.0
    • Code
    • None

    Description

      Some identical methods are repeated in many appender classes. These should be moved to the parent LoggerAppender abstract class.

      The default constructor and destructor are often repeated in each appender class, or they only call the parent contructor/destructor explicitely which is not required. The default implemetnations of these are:

      public function __construct($name = '') {
      $this->name = $name;
      }

      public function __destruct() {
      $this->close();
      }

      Also, many of the appenders have the following implementation of activateOptions() and close():

      public function activateOptions() {
      $this->closed = false;
      }

      public function __destruct() {
      $this->close();
      }

      These 4 functions can be moved to the parent class LoggerAppender, and removed from the subclasses which use the default implementation.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: