You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mailet-api@james.apache.org by "Norman Maurer (JIRA)" <ma...@james.apache.org> on 2011/01/20 18:14:44 UTC

[jira] Created: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

MailetContext should provide a log method which allow to specify the loglevel
-----------------------------------------------------------------------------

                 Key: MAILET-33
                 URL: https://issues.apache.org/jira/browse/MAILET-33
             Project: Mailet
          Issue Type: Improvement
          Components: Core API
    Affects Versions: 2.4
            Reporter: Norman Maurer
             Fix For: 2.5


Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Norman Maurer (JIRA)" <ma...@james.apache.org>.
     [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer resolved MAILET-33.
---------------------------------

    Resolution: Fixed
      Assignee: Norman Maurer

done

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Stefano Bagnara (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984622#action_12984622 ] 

Stefano Bagnara commented on MAILET-33:
---------------------------------------

This is the cause of my doubts. The stringformat one gives us more performance (expecially with debug strings when debug is not enabled), on the other side we have the current log with no level and a simple string (so we already have a very KISS solution). On the other side (the KISS) we could add an isLogEnabled(Level level) method and still let people doing something only when debug is enabled.

Maybe most users are more used to the non-varargs solution and the isLogEnabled(Level) approach, don't know.

As we moved to java5 I wanted to raise this possible solution, but this was just something on the table, not something I "push".

Any other opinion?

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Eric Charles (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984644#action_12984644 ] 

Eric Charles commented on MAILET-33:
------------------------------------

About logging performance slf4f in documented to perform well:
http://www.slf4j.org/faq.html#logging_performance
(This is not a comment on the way to set the log level)


> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Stefano Bagnara (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984688#action_12984688 ] 

Stefano Bagnara commented on MAILET-33:
---------------------------------------

ok, I swapped the arguments so that LogLevel is always the first, and added the @since tags.

I didn't add the isLogEnabled method. If anyone thinks that we should care of this performance aspect and provide it in the api please speak before we release 2.5


> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Stefano Bagnara (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984650#action_12984650 ] 

Stefano Bagnara commented on MAILET-33:
---------------------------------------

It is interesting to see they do not use String.format but their own format for performance reasons. I don't want mailet api to introduce a new format and if String.format is not so performant maybe we should simply go with methods suggested by Norman.

Do we want to publish the "boolean isLogEnabled(LogLevel l)" api ?

Also, I prefer to have 
    void log(LogLevel level, String message);
instead of the committed:
    void log(String message, LogLevel level);
Hope you don't see problems with this.

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Norman Maurer (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984653#action_12984653 ] 

Norman Maurer commented on MAILET-33:
-------------------------------------

I don't care if we swap the arguments and also don't have a strong opinion on isLogEnabled(Loglevel). Well I don't think its really something needed but If others think its useful.. 

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Stefano Bagnara (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984452#action_12984452 ] 

Stefano Bagnara commented on MAILET-33:
---------------------------------------

As a compromise between performance and code verbosity I often see java5 logging based on varargs:

log(Level level, String formatString, Object... params);
log(Level level, Throwable t, String formatString, Object... params);

The final message is created using String.format(formatString, params) so the implementation can delay the formatting after checking if the loglevel is enabled.

This also allow the simple call:
log(Level.DEBUG, "simple log with no arguments");

What do you think?

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAILET-33) MailetContext should provide a log method which allow to specify the loglevel

Posted by "Norman Maurer (JIRA)" <ma...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/MAILET-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984588#action_12984588 ] 

Norman Maurer commented on MAILET-33:
-------------------------------------

I'm also fine with this. Just tried to follow KISS ;) 

> MailetContext should provide a log method which allow to specify the loglevel
> -----------------------------------------------------------------------------
>
>                 Key: MAILET-33
>                 URL: https://issues.apache.org/jira/browse/MAILET-33
>             Project: Mailet
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 2.4
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>             Fix For: 2.5
>
>
> Currently MailetContext.log(..) does not allow to specify the loglevel to use for logging. We should mark this method as @deprecated and add a new one which takes a  logging level argument.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.