logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Ståldal (JIRA) <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1807) [core] Add and implement LogEvent.toImmutable()
Date Fri, 17 Feb 2017 15:06:41 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15871942#comment-15871942
] 

Mikael Ståldal commented on LOG4J2-1807:
----------------------------------------

It looks strange to me that two methods with such similar signatures in {{Log4jLogEvent}}
have so different implementations:

{code}
    public static LogEvent createMemento(final LogEvent logEvent) {
        return new Log4jLogEvent.Builder(logEvent).build();
    }
    
    /**
     * Creates and returns a new immutable copy of this {@code Log4jLogEvent}.
     *
     * @return a new immutable copy of the data in this {@code Log4jLogEvent}
     */
    public static Log4jLogEvent createMemento(final LogEvent event, final boolean includeLocation)
{
        return deserialize(serialize(event, includeLocation));
    }
{code}

> [core] Add and implement LogEvent.toImmutable()
> -----------------------------------------------
>
>                 Key: LOG4J2-1807
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1807
>             Project: Log4j 2
>          Issue Type: New Feature
>    Affects Versions: 2.8.1
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>         Attachments: logging-log4j2.patch
>
>
> [core] Add and implement LogEvent.asImmutable()
> {code:java}
>     /**
>      * Returns an immutable version of this log event, which MAY BE a copy of this event.
>      *  
>      * @return an immutable version of this log event
>      */
>     LogEvent asImmutable();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message