Use TinyLog for protocol logging

pull/214/head
M66B 10 months ago
parent 067c3e3a59
commit f747721559

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

@ -289,6 +289,11 @@ public class Log {
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) {
if (BuildConfig.BETA_RELEASE)
try {

Loading…
Cancel
Save