Skip to content

Commit df9df82

Browse files
committed
Added tag (Class + method + line number) to log file interceptor
1 parent 64df09d commit df9df82

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

log/src/main/java/ua/at/tsvetkov/util/AbstactLog.java renamed to log/src/main/java/ua/at/tsvetkov/util/AbstractLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import ua.at.tsvetkov.util.interceptor.LogCatInterceptor;
66
import ua.at.tsvetkov.util.interceptor.LogInterceptor;
77

8-
class AbstactLog {
8+
class AbstractLog {
99

1010
static final HashSet<LogInterceptor> interceptors = new HashSet<>();
1111

log/src/main/java/ua/at/tsvetkov/util/Log.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import java.util.List;
3131
import java.util.Map;
3232

33-
import ua.at.tsvetkov.util.interceptor.LogInterceptor;
34-
3533
import static java.lang.Thread.currentThread;
3634
import static ua.at.tsvetkov.util.Format.NL;
3735
import static ua.at.tsvetkov.util.Format.addMessage;
@@ -40,7 +38,6 @@
4038
import static ua.at.tsvetkov.util.Format.getFormattedMessage;
4139
import static ua.at.tsvetkov.util.Format.getFormattedThrowable;
4240
import static ua.at.tsvetkov.util.Format.getTag;
43-
import static ua.at.tsvetkov.util.interceptor.LogInterceptor.Level;
4441
import static ua.at.tsvetkov.util.interceptor.LogInterceptor.Level.DEBUG;
4542
import static ua.at.tsvetkov.util.interceptor.LogInterceptor.Level.ERROR;
4643
import static ua.at.tsvetkov.util.interceptor.LogInterceptor.Level.INFO;
@@ -54,7 +51,7 @@
5451
*
5552
* @author A.Tsvetkov 2010 http://tsvetkov.at.ua mailto:al@ukr.net
5653
*/
57-
public class Log extends AbstactLog {
54+
public class Log extends AbstractLog {
5855

5956
static volatile boolean isLogOutlined = true;
6057
static volatile boolean isAlignNewLines = false;

log/src/main/java/ua/at/tsvetkov/util/LongLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*
5656
* @author A.Tsvetkov 2018 http://tsvetkov.at.ua mailto:al@ukr.net
5757
*/
58-
public class LongLog extends AbstactLog {
58+
public class LongLog extends AbstractLog {
5959

6060
/**
6161
* Default size for message string.

log/src/main/java/ua/at/tsvetkov/util/interceptor/LogToFileInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void log(Level level, String tag, String msg, Throwable th) {
5555
Log.w(TAG, "Log file is not set");
5656
return;
5757
}
58-
final String message = new Date().toString() + " " + level + " " + msg;
58+
final String message = new Date().toString() + " " + level + " " + tag + ": " + msg;
5959
writeAsync(message);
6060
}
6161

0 commit comments

Comments
 (0)