You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Remko Popma <re...@gmail.com> on 2014/09/03 12:07:49 UTC

Re: git commit: Move longish comment before code.

I just noticed, but we should not convert Messages to strings to make async loggers work. (This wastes CPU if the level is too low and the message doesn't get logged.)

I wonder if there are other placed where this is happening. 

Sent from my iPhone

> On 2014/09/02, at 22:45, ggregory@apache.org wrote:
> 
> Repository: logging-log4j2
> Updated Branches:
>  refs/heads/master a497e405f -> acba5dc88
> 
> 
> Move longish comment before code.
> 
> Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
> Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/acba5dc8
> Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/acba5dc8
> Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/acba5dc8
> 
> Branch: refs/heads/master
> Commit: acba5dc889c865b18b1a9bd008a8cffab1308703
> Parents: a497e40
> Author: Gary Gregory <ga...@gmail.com>
> Authored: Tue Sep 2 09:45:30 2014 -0400
> Committer: Gary Gregory <ga...@gmail.com>
> Committed: Tue Sep 2 09:45:30 2014 -0400
> 
> ----------------------------------------------------------------------
> .../org/apache/logging/log4j/streams/util/CharStreamLogger.java  | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/acba5dc8/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
> ----------------------------------------------------------------------
> diff --git a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
> index 4e136ed..3eb0851 100644
> --- a/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
> +++ b/log4j-streams/src/main/java/org/apache/logging/log4j/streams/util/CharStreamLogger.java
> @@ -103,8 +103,8 @@ public class CharStreamLogger {
>     }
> 
>     private void log(final String fqcn) {
> -        logger.logIfEnabled(fqcn, level, marker, msg.toString()); // convert to string now so async loggers
> -                                                         // work
> +        // convert to string now so async loggers work
> +        logger.logIfEnabled(fqcn, level, marker, msg.toString());
>         msg.setLength(0);
>     }
> }
> 

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