Log4php
  1. Log4php
  2. LOG4PHP-151

Move common appender methods to parent class

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: Code
    • Labels:
      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.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2h 20m 1 Ivan Habunek 07/Sep/11 14:50
        Resolved Resolved Closed Closed
        815d 21h 4m 1 Ivan Habunek 01/Dec/13 10:54
        Ivan Habunek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Ivan Habunek made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ivan Habunek added a comment -

        Done. This should make the appender code more readable.

        Show
        Ivan Habunek added a comment - Done. This should make the appender code more readable.
        Ivan Habunek created issue -

          People

          • Assignee:
            Ivan Habunek
            Reporter:
            Ivan Habunek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development