Bookmark Topic Watch Topic
  • New Topic

Logging ..adivse  RSS feed

 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Report post to moderator
I find many people are using string concatination for logging.

for example:
String path="http://www.xyz.com";
String tempVar="testing";
logger.info("Successfully completed task: " + tempVar + ". Path = " + path);

Instead of the above code..I would like to write :

logger.info(new StringBuffer().append("Successfully completed task: ").append(tempVar).append(". Path = ").append(path).toString());

Request an expert advise...

Thanks in advance to all
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same topic to multiple forums.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!