Use TinyLog for protocol logging

pull/214/head
M66B 2 years ago
parent 067c3e3a59
commit f747721559

@ -786,14 +786,11 @@ public class EmailService implements AutoCloseable {
try { try {
if (((char) b) == '\n') { if (((char) b) == '\n') {
String line = bos.toString(); String line = bos.toString();
if (!line.endsWith("ignoring socket timeout")) if (log)
if (log) if (line.endsWith("ignoring socket timeout"))
EntityLog.log(context, EntityLog.Type.Protocol, user + " " + line); Log.d("javamail", user + " " + line);
else { else
breadcrumbs.push(line); Log.w("javamail", user + " " + line);
if (BuildConfig.DEBUG)
Log.i("javamail", user + " " + line);
}
bos.reset(); bos.reset();
} else } else
bos.write(b); bos.write(b);

@ -289,6 +289,11 @@ public class Log {
return 0; return 0;
} }
public static int w(String tag, String msg) {
org.tinylog.Logger.tag(tag).warn(msg);
return 0;
}
public static int w(Throwable ex) { public static int w(Throwable ex) {
if (BuildConfig.BETA_RELEASE) if (BuildConfig.BETA_RELEASE)
try { try {

Loading…
Cancel
Save