[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2024-02-11 Thread Elliotte Rusty Harold (Jira)


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

Elliotte Rusty Harold commented on LOGGING-136:
---

sounds like this issue should be closed a won't do.
Deprecation of this library is a separate question. I don't mind recommending 
other libraries in preference to this one, but I do think we need to be aware 
that this is already deeply embedded in many projects so some level of support 
that doesn't require a migration to something else is valuable.

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>Priority: Major
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-16 Thread Remko Popma (JIRA)

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

Remko Popma commented on LOGGING-136:
-

+1 to deprecate commons-logging and recommend users to upgrade to the Log4j 2 
API. 

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-14 Thread JIRA

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

Ceki Gülcü commented on LOGGING-136:


SLF4J version 2.0 will support lambda expressions and much more.

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-13 Thread Ralph Goers (JIRA)

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

Ralph Goers commented on LOGGING-136:
-

SLF4J does not support lambda expressions and does not support the printf style 
expressions Sam showed above. The Log4j API supports both.

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-13 Thread Martin Grigorov (JIRA)

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

Martin Grigorov commented on LOGGING-136:
-

+1 to deprecate commons-logging and recommend users to move to LOG4J2 or SLF4J.

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-13 Thread Gary Gregory (JIRA)

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

Gary Gregory commented on LOGGING-136:
--

I think Commons Logging should be deprecated in favor of Apache's own Log4j 2 
logging API, which supports Java 8 lambda calls (but only requires Java 7): I 
would use Log4j 2's {{log4-api}} module and pick an suitable implementation 
(like Log4j's own {{log4j-core}}). Log4j 2 provides separation between the API 
and different plugin implementations. Please see 
https://logging.apache.org/log4j/2.x/

With Log4j 2, you can say:
{code:java}
logger.trace("Some long-running operation returned {}", () -> 
expensiveOperation());
{code}

See https://logging.apache.org/log4j/2.x/manual/api.html and 
https://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

If you want to try it, use the following in your POM instead of Commons Logging:

{code:xml}

  
org.apache.logging.log4j
log4j-api
2.6.2
  
  
org.apache.logging.log4j
log4j-core
2.6.2
  

{code}

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (LOGGING-136) API Enhancements: 'String.format(String, Object...)' Functionality & Delegate Convenience Methods

2016-07-13 Thread Sam Brannen (JIRA)

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

Sam Brannen commented on LOGGING-136:
-

Dear Commons Logging Team,

I think I speak for the entire community when I say that having to write code 
like the following in 2016 (especially on Java 8) is more than painful.

{code:java}
if (logger.isDebugEnabled()) {
logger.debug(String.format("Delegating to %s to process context 
configuration %s.",
name(loader), configAttributes));
}
{code}

The above could be replaced with something along the lines of what the reporter 
suggested:

{code:java}
logger.debug("Delegating to %s to process context configuration %s.",
name(loader), configAttributes);
{code}

And if you'd like to be kind to the Java 8+ community (which is growing daily), 
it would be great if you introduced support for lambda expressions as well, 
like the following:

{code:java}
logger.debug(() -> String.format("Delegating to %s to process context 
configuration %s.",
name(loader), configAttributes));
{code}

The above would naturally work with a functional interface that is not 
physically annotated with {{@FunctionalInterface}}, thereby supporting Java 6 
or Java 7; any single abstract method interface will suffice.

Is there any chance you will release Commons Logging 2.0 in 2016 with updated, 
modern APIs?

Thanks in advance for your consideration!

Sam Brannen

> API Enhancements: 'String.format(String, Object...)' Functionality & Delegate 
> Convenience Methods
> -
>
> Key: LOGGING-136
> URL: https://issues.apache.org/jira/browse/LOGGING-136
> Project: Commons Logging
>  Issue Type: Improvement
>Affects Versions: 1.1.1
> Environment: N/A
>Reporter: Daniel Siviter
>  Labels: api, api-addition
> Fix For: 2.0
>
> Attachments: commons-logging-1.1.1-src.rar, 
> commons-logging-1.1.1.jar, site.rar
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Improvements to the API to allow convenience methods for performing 
> {{String.format(String, Object...)}} and allow access to the internal logging 
> delegate.
> Firstly, to add the {{String#format(String, Object...)}} functionality modify 
> the methods (note: only {{#trace(...)}} shown):
> {{void trace(Object message, Object... args);}}
> {{void trace(Object message, Throwable t, Object... args);}}
> This would allow compatiblity with previous versions of the API (although I 
> believe they would still require a re-compile) and help tidy up code.
> Secondly, to obtain access to the internal instance of a logger the addition 
> of a {{#getDeletegate()}} method.
> I can supply the code if required.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)