You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Ivan Habunek (JIRA)" <ji...@apache.org> on 2011/09/07 13:31:10 UTC

[jira] [Created] (LOG4PHP-151) Move common appender methods to parent class

Move common appender methods to parent class
--------------------------------------------

                 Key: LOG4PHP-151
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-151
             Project: Log4php
          Issue Type: Improvement
          Components: Code
    Affects Versions: 2.1
            Reporter: Ivan Habunek
            Assignee: Ivan Habunek
            Priority: Minor
             Fix For: 2.2


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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (LOG4PHP-151) Move common appender methods to parent class

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek resolved LOG4PHP-151.
----------------------------------

    Resolution: Fixed

Done. This should make the appender code more readable.

> Move common appender methods to parent class
> --------------------------------------------
>
>                 Key: LOG4PHP-151
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-151
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>    Affects Versions: 2.1
>            Reporter: Ivan Habunek
>            Assignee: Ivan Habunek
>            Priority: Minor
>             Fix For: 2.2
>
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira