Just provide the classname and method when providing log message context.

Tidied up some other bits.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2106 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2007-05-23 18:37:34 +00:00
parent b18001332f
commit 9d9f8a68c3
@@ -72,14 +72,12 @@ public class OneLineLogFormatter extends Formatter
if (_showWhere) {
// append the log method call context
String where = record.getSourceClassName();
boolean legacy = (where.indexOf("LoggingLogProvider") != -1);
if (where != null && !legacy) {
String logger = record.getLoggerName();
if (logger != null && where.startsWith(logger) &&
where.length() > logger.length()) {
where = where.substring(logger.length()+1);
}
} else {
if (where != null) {
// strip the package name from the logging class
where = where.substring(where.lastIndexOf(".")+1);
}
boolean legacy = where.equals("Log") || where.equals("LoggingLogProvider");
if (legacy) {
where = record.getLoggerName();
}
buf.append(where);