mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
fix Logging test for tails=true build
In the tails=true build, the calling method cannot always be determined due to stack frames being optimized away, so we must be prepared for LogRecord.getSourceMethodName to return null.
This commit is contained in:
parent
792653e190
commit
5dbcbb825b
@ -49,8 +49,12 @@ public class Logging {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(r.getLoggerName());
|
||||
indent(sb, NAME_WIDTH - r.getLoggerName().length());
|
||||
sb.append(r.getSourceMethodName());
|
||||
indent(sb, METHOD_WIDTH - r.getSourceMethodName().length());
|
||||
String methodName = r.getSourceMethodName();
|
||||
if (methodName == null) {
|
||||
methodName = "<unknown>";
|
||||
}
|
||||
sb.append(methodName);
|
||||
indent(sb, METHOD_WIDTH - methodName.length());
|
||||
sb.append(r.getLevel().getName());
|
||||
indent(sb, LEVEL_WIDTH - r.getLevel().getName().length());
|
||||
sb.append(r.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user