From 9eaa0b626b0b64ca4eedbbbeb4859dff6d8212fd Mon Sep 17 00:00:00 2001 From: Abraham Hedtke Date: Tue, 5 Jan 2016 16:43:08 -0500 Subject: [PATCH] Fix all calls to Log so that they pass in the constant LOG_TAG with the value "Affdex" --- app/src/main/java/com/affectiva/affdexme/ImageHelper.java | 2 +- app/src/main/java/com/affectiva/affdexme/MainActivity.java | 2 +- .../com/affectiva/affdexme/MetricSelectionFragment.java | 4 ++-- .../main/java/com/affectiva/affdexme/PreferencesUtils.java | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/affectiva/affdexme/ImageHelper.java b/app/src/main/java/com/affectiva/affdexme/ImageHelper.java index f991b32..c7adb83 100644 --- a/app/src/main/java/com/affectiva/affdexme/ImageHelper.java +++ b/app/src/main/java/com/affectiva/affdexme/ImageHelper.java @@ -19,7 +19,7 @@ import java.io.IOException; public class ImageHelper { - private static final String LOG_TAG = ImageHelper.class.getSimpleName(); + private static final String LOG_TAG = "AffdexMe"; // Prevent instantiation of this object private ImageHelper() { diff --git a/app/src/main/java/com/affectiva/affdexme/MainActivity.java b/app/src/main/java/com/affectiva/affdexme/MainActivity.java index 7f92eeb..d7fc8a3 100644 --- a/app/src/main/java/com/affectiva/affdexme/MainActivity.java +++ b/app/src/main/java/com/affectiva/affdexme/MainActivity.java @@ -81,7 +81,7 @@ public class MainActivity extends AppCompatActivity public static final int MAX_SUPPORTED_FACES = 4; public static final int NUM_METRICS_DISPLAYED = 6; - private static final String LOG_TAG = "Affectiva"; + private static final String LOG_TAG = "AffdexMe"; private static final int AFFDEXME_PERMISSIONS_REQUEST = 42; //value is arbitrary (between 0 and 255) int cameraPreviewWidth = 0; int cameraPreviewHeight = 0; diff --git a/app/src/main/java/com/affectiva/affdexme/MetricSelectionFragment.java b/app/src/main/java/com/affectiva/affdexme/MetricSelectionFragment.java index d1372d8..d16f041 100644 --- a/app/src/main/java/com/affectiva/affdexme/MetricSelectionFragment.java +++ b/app/src/main/java/com/affectiva/affdexme/MetricSelectionFragment.java @@ -31,7 +31,7 @@ import static com.affectiva.affdexme.MainActivity.NUM_METRICS_DISPLAYED; */ public class MetricSelectionFragment extends Fragment implements View.OnClickListener { - final static String LOG_TAG = "Affectiva"; + final static String LOG_TAG = "AffdexMe"; int numberOfSelectedItems = 0; @@ -267,7 +267,7 @@ public class MetricSelectionFragment extends Fragment implements View.OnClickLis item.setOnClickListener(this); gridLayout.addView(item); } else { - Log.e(this.getClass().getSimpleName(), "Unknown MetricSelector item for Metric: " + metric.toString()); + Log.e(LOG_TAG, "Unknown MetricSelector item for Metric: " + metric.toString()); } } currentRow.value += 1; //point currentRow to row where next views should be added diff --git a/app/src/main/java/com/affectiva/affdexme/PreferencesUtils.java b/app/src/main/java/com/affectiva/affdexme/PreferencesUtils.java index 2c98435..a88d651 100644 --- a/app/src/main/java/com/affectiva/affdexme/PreferencesUtils.java +++ b/app/src/main/java/com/affectiva/affdexme/PreferencesUtils.java @@ -9,6 +9,7 @@ import android.util.Log; public class PreferencesUtils { static final int DEFAULT_FPS = 20; + private final static String LOG_TAG = "AffdexMe"; /** * Attempt to parse and return FPS set by user. If the FPS is invalid, we set it to be the default FPS. @@ -87,21 +88,21 @@ public class PreferencesUtils { emotion = MetricsManager.Emotions.valueOf(metricString); return emotion; } catch (IllegalArgumentException emotionParseFailed) { - Log.v(PreferencesUtils.class.getSimpleName(), "Not an Emotion..."); + Log.v(LOG_TAG, "Not an Emotion..."); } try { MetricsManager.Expressions expression; expression = MetricsManager.Expressions.valueOf(metricString); return expression; } catch (IllegalArgumentException expressionParseFailed) { - Log.v(PreferencesUtils.class.getSimpleName(), "Not an Expression..."); + Log.v(LOG_TAG, "Not an Expression..."); } try { MetricsManager.Emojis emoji; emoji = MetricsManager.Emojis.getEnum(metricString); return emoji; } catch (IllegalArgumentException expressionParseFailed) { - Log.v(PreferencesUtils.class.getSimpleName(), "Not an Emoji..."); + Log.v(LOG_TAG, "Not an Emoji..."); } throw new IllegalArgumentException("String did not match any known metric"); }