diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-12-10 20:01:50 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-12-10 20:01:50 +0100 |
commit | a7454223008c78dcf5e0ff727bca64241f99daa1 (patch) | |
tree | f9ab1f2834743fc1cf9970636c0862d209c51c5e /src/main/java/de/thedevstack/conversationsplus/utils | |
parent | eb5a7a5392ec93976d91d5576a3496ceac473d03 (diff) |
Moved logcat to a module, increased error robustness for loading last messages
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils')
7 files changed, 10 insertions, 132 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/AvatarUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/AvatarUtil.java index 87b9eb32..660100a3 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/AvatarUtil.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/AvatarUtil.java @@ -4,7 +4,6 @@ import android.graphics.Bitmap; import android.net.Uri; import android.util.Base64; import android.util.Base64OutputStream; -import de.thedevstack.conversationsplus.utils.Logging; import java.io.ByteArrayOutputStream; import java.io.File; @@ -16,6 +15,7 @@ import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import de.thedevstack.android.logcat.Logging; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.ConversationsPlusApplication; import de.thedevstack.conversationsplus.xmpp.pep.Avatar; diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/DNSHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/DNSHelper.java index bd7a6623..aa16b06b 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/DNSHelper.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/DNSHelper.java @@ -10,8 +10,6 @@ import de.measite.minidns.record.A; import de.measite.minidns.record.AAAA; import de.measite.minidns.record.Data; import de.measite.minidns.util.NameUtil; -import de.thedevstack.conversationsplus.Config; -import de.thedevstack.conversationsplus.xmpp.jid.Jid; import java.io.IOException; import java.net.InetAddress; @@ -23,7 +21,10 @@ import java.util.TreeMap; import java.util.regex.Pattern; import android.os.Bundle; -import de.thedevstack.conversationsplus.utils.Logging; + +import de.thedevstack.android.logcat.Logging; +import de.thedevstack.conversationsplus.Config; +import de.thedevstack.conversationsplus.xmpp.jid.Jid; public class DNSHelper { diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ExceptionHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/ExceptionHelper.java index dc8ca40d..32f45127 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/ExceptionHelper.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/ExceptionHelper.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.List; +import de.thedevstack.android.logcat.Logging; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.ConversationsPlusPreferences; import de.thedevstack.conversationsplus.R; @@ -26,7 +27,6 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.preference.PreferenceManager; import android.text.format.DateUtils; -import de.thedevstack.conversationsplus.utils.Logging; public class ExceptionHelper { public static void init(Context context) { diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ExifHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/ExifHelper.java index 7aaf8b0b..576698ce 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/ExifHelper.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/ExifHelper.java @@ -16,7 +16,7 @@ package de.thedevstack.conversationsplus.utils; -import de.thedevstack.conversationsplus.utils.Logging; +import de.thedevstack.android.logcat.Logging; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java index 1d126db5..7e8cacd0 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java @@ -7,7 +7,6 @@ import android.graphics.Matrix; import android.graphics.RectF; import android.media.ExifInterface; import android.net.Uri; -import de.thedevstack.conversationsplus.utils.Logging; import android.util.LruCache; import java.io.File; @@ -15,6 +14,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import de.thedevstack.android.logcat.Logging; import de.thedevstack.conversationsplus.entities.Message; import de.thedevstack.conversationsplus.persistance.FileBackend; diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/Logging.java b/src/main/java/de/thedevstack/conversationsplus/utils/Logging.java deleted file mode 100644 index 40ec66a0..00000000 --- a/src/main/java/de/thedevstack/conversationsplus/utils/Logging.java +++ /dev/null @@ -1,124 +0,0 @@ -package de.thedevstack.conversationsplus.utils; - -import android.util.Log; - -/** - * Created by tzur on 20.11.2015. - */ -public class Logging { - protected static final String LOG_TAG_PREFIX = "thedevstack."; - /** - * Send a {@link Log#VERBOSE} log message. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - */ - public static int v(String tag, String msg) { - return Log.v(Logging.LOG_TAG_PREFIX + tag, msg); - } - - /** - * Send a {@link Log#VERBOSE} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - * @param tr An exception to log - */ - public static int v(String tag, String msg, Throwable tr) { - return Log.v(Logging.LOG_TAG_PREFIX + tag, msg + '\n' + Log.getStackTraceString(tr)); - } - - /** - * Send a {@link Log#DEBUG} log message. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - */ - public static int d(String tag, String msg) { - return Log.d(Logging.LOG_TAG_PREFIX + tag, msg); - } - - /** - * Send a {@link Log#DEBUG} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - * @param tr An exception to log - */ - public static int d(String tag, String msg, Throwable tr) { - return Log.d(Logging.LOG_TAG_PREFIX + tag, msg + '\n' + Log.getStackTraceString(tr)); - } - - /** - * Send an {@link Log#INFO} log message. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - */ - public static int i(String tag, String msg) { - return Log.i(Logging.LOG_TAG_PREFIX + tag, msg); - } - - /** - * Send a {@link Log#INFO} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - * @param tr An exception to log - */ - public static int i(String tag, String msg, Throwable tr) { - return Log.i(Logging.LOG_TAG_PREFIX + tag, msg + '\n' + Log.getStackTraceString(tr)); - } - - /** - * Send a {@link Log#WARN} log message. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - */ - public static int w(String tag, String msg) { - return Log.w(Logging.LOG_TAG_PREFIX + tag, msg); - } - - /** - * Send a {@link Log#WARN} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - * @param tr An exception to log - */ - public static int w(String tag, String msg, Throwable tr) { - return Log.w(Logging.LOG_TAG_PREFIX + tag, msg + '\n' + Log.getStackTraceString(tr)); - } - - /* - * Send a {@link #WARN} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param tr An exception to log - */ - public static int w(String tag, Throwable tr) { - return Log.w(Logging.LOG_TAG_PREFIX + tag, Log.getStackTraceString(tr)); - } - - /** - * Send an {@link Log#ERROR} log message. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - */ - public static int e(String tag, String msg) { - return Log.e(Logging.LOG_TAG_PREFIX + tag, msg); - } - - /** - * Send a {@link Log#ERROR} log message and log the exception. - * @param tag Used to identify the source of a log message. It usually identifies - * the class or activity where the log call occurs. - * @param msg The message you would like logged. - * @param tr An exception to log - */ - public static int e(String tag, String msg, Throwable tr) { - return Log.e(Logging.LOG_TAG_PREFIX + tag, msg + '\n' + Log.getStackTraceString(tr)); - } -} diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/PRNGFixes.java b/src/main/java/de/thedevstack/conversationsplus/utils/PRNGFixes.java index ca4d65ff..0751809c 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/PRNGFixes.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/PRNGFixes.java @@ -2,7 +2,6 @@ package de.thedevstack.conversationsplus.utils; import android.os.Build; import android.os.Process; -import de.thedevstack.conversationsplus.utils.Logging; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; @@ -19,6 +18,8 @@ import java.security.SecureRandom; import java.security.SecureRandomSpi; import java.security.Security; +import de.thedevstack.android.logcat.Logging; + /** * Fixes for the output of the default PRNG having low entropy. * |