Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/lyubick/passha.git
Browse files Browse the repository at this point in the history
  • Loading branch information
lyubick committed Apr 11, 2015
2 parents 67e1e55 + 44b8be4 commit da2f338
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/logger/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ private void prepareAndLog(LOGLEVELS lvl, String msg)
StackTraceElement e = stacktrace[3];

String methodName = e.getMethodName();
String fileName = e.getFileName();
String fileName = "(" + e.getFileName();

int line = e.getLineNumber();
String line = "" + e.getLineNumber() + ")";

fileNameWidth = Math.max(fileNameWidth, fileName.length());
lineWidth = Math.max(lineWidth, Integer.toString(line).length());
lineWidth = Math.max(lineWidth, line.length());
methodNameWidth = Math.max(methodNameWidth, methodName.length());

writeToFileAndToScreen(
String.format("[%1$s] %2$" + fileNameWidth + "s @ %3$-" + lineWidth + "d %4$-"
String.format("[%1$s] %2$" + fileNameWidth + "s:%3$-" + lineWidth + "s %4$-"
+ methodNameWidth + "s ", getTime(), fileName, line, methodName)
+ lvl.name() + ": " + msg, lvl);
}
Expand Down

0 comments on commit da2f338

Please sign in to comment.