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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user