logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Ståldal <mikael.stal...@magine.com>
Subject Re: CharSequence messages
Date Fri, 03 Jun 2016 16:19:08 GMT
If provide a way for custom Logger:s to get access to MessageFactory2, then
we would not need such instanceof check in AbstractMessageFactory, since
the custom logger could invoke MessageFactory2.newMessage(CharSequence)
directly.

On Fri, Jun 3, 2016 at 6:10 PM, Gary Gregory <garydgregory@gmail.com> wrote:

> Talk about NOT object-oriented though! :-(
> On Jun 3, 2016 3:49 AM, "Mikael Ståldal" <mikael.staldal@magine.com>
> wrote:
>
>> Would it make sense if AbstractMessageFactory was changed so that this
>> method:
>>
>> @Override
>> public Message newMessage(final Object message) {
>>     return new ObjectMessage(message);
>> }
>>
>> did this:
>>
>> @Override
>> public Message newMessage(final Object message) {
>>     if (message instanceof CharSequence) {
>>         return new SimpleMessage((CharSequence) message)
>>     } else {
>>         return new ObjectMessage(message);
>>     }
>> }
>>
>>
>> --
>> [image: MagineTV]
>>
>> *Mikael Ståldal*
>> Senior software developer
>>
>> *Magine TV*
>> mikael.staldal@magine.com
>> Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com
>>
>> Privileged and/or Confidential Information may be contained in this
>> message. If you are not the addressee indicated in this message
>> (or responsible for delivery of the message to such a person), you may
>> not copy or deliver this message to anyone. In such case,
>> you should destroy this message and kindly notify the sender by reply
>> email.
>>
>


-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Grev Turegatan 3  | 114 46 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Mime
View raw message