Skip to content

Commit

Permalink
Update FxR Java logging to include class name in LOGTAG
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Aug 29, 2019
1 parent 105bd17 commit 520e76d
Show file tree
Hide file tree
Showing 40 changed files with 76 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import org.mozilla.vrbrowser.utils.ConnectivityReceiver;
import org.mozilla.vrbrowser.utils.LocaleUtils;
import org.mozilla.vrbrowser.utils.ServoUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.io.IOException;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -112,7 +113,7 @@ public void run() {
static final int SwipeDelay = 1000; // milliseconds
static final long RESET_CRASH_COUNT_DELAY = 5000;

static final String LOGTAG = "VRB";
static final String LOGTAG = SystemUtils.createLogtag(VRBrowserActivity.class);
HashMap<Integer, Widget> mWidgets;
private int mWidgetHandleIndex = 1;
AudioEngine mAudioEngine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
package org.mozilla.vrbrowser.audio;

import android.content.Context;

import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.concurrent.ConcurrentHashMap;

public class AudioEngine {
Expand All @@ -15,7 +18,7 @@ public class AudioEngine {
private float mMasterVolume = 1.0f;
private static ConcurrentHashMap<Context, AudioEngine> mEngines = new ConcurrentHashMap<>();
private boolean mEnabled;
private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(AudioEngine.class);

public enum SoundType {
STEREO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import androidx.annotation.NonNull;

import org.mozilla.geckoview.MediaElement;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.concurrent.CopyOnWriteArrayList;

public class Media implements MediaElement.Delegate {
private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(Media.class);
private boolean mIsFullscreen = false;
private double mCurrentTime = 0.0f;
private MediaElement.Metadata mMetaData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.mozilla.vrbrowser.browser.engine.SessionStore;
import org.mozilla.vrbrowser.ui.widgets.WidgetManagerDelegate;
import org.mozilla.vrbrowser.ui.widgets.dialogs.PermissionWidget;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -22,7 +23,7 @@ public class PermissionDelegate implements GeckoSession.PermissionDelegate, Widg

static final int PERMISSION_REQUEST_CODE = 1143;

static final String LOGTAG = "VRB";
static final String LOGTAG = SystemUtils.createLogtag(PermissionDelegate.class);
private Context mContext;
private int mParentWidgetHandle;
private WidgetManagerDelegate mWidgetManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.mozilla.vrbrowser.utils.DeviceType;
import org.mozilla.vrbrowser.utils.LocaleUtils;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import androidx.annotation.NonNull;

Expand All @@ -26,7 +27,7 @@

public class SettingsStore {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(SettingsStore.class);

private static SettingsStore mSettingsInstance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.json.JSONException;
import org.json.JSONObject;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -19,7 +20,7 @@
import java.util.List;

public class UserAgentOverride {
private final static String LOGTAG = "VRB";
private final static String LOGTAG = SystemUtils.createLogtag(UserAgentOverride.class);
private static final String NO_OVERRIDE_FOUND = "NO OVERRIDE USER AGENT FOUND";
private ArrayMap<String, String> mOverrideMap;
private ArrayMap<String, String> mOverrideCache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.mozilla.vrbrowser.geolocation.GeolocationData;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.utils.InternalPages;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.net.URI;
import java.net.URISyntaxException;
Expand All @@ -55,8 +56,7 @@ public class SessionStack implements ContentBlocking.Delegate, GeckoSession.Navi
GeckoSession.PromptDelegate, GeckoSession.MediaDelegate, GeckoSession.HistoryDelegate,
SharedPreferences.OnSharedPreferenceChangeListener {

private static final String LOGTAG = "VRB";

private static final String LOGTAG = SystemUtils.createLogtag(SessionStack.class);
// You can test a local file using: "resource://android/assets/webvr/index.html"
public static final int NO_SESSION = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.VRBrowserActivity;
import org.mozilla.vrbrowser.browser.SettingsStore;
import org.mozilla.vrbrowser.utils.SystemUtils;

import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;

public class CrashReporterService extends JobIntentService {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(CrashReporterService.class);

public static final String CRASH_ACTION = BuildConfig.APPLICATION_ID + ".CRASH_ACTION";
public static final String DATA_TAG = "intent";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
import android.util.Log;

import org.mozilla.gecko.CrashHandler;
import org.mozilla.vrbrowser.utils.SystemUtils;

import androidx.annotation.NonNull;

public class GlobalExceptionHandler {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(GlobalExceptionHandler.class);

private static GlobalExceptionHandler mInstance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.json.JSONException;
import org.json.JSONObject;
import org.mozilla.vrbrowser.utils.SystemUtils;

import androidx.annotation.NonNull;

Expand All @@ -12,7 +13,7 @@
*/
public class GeolocationData {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(GeolocationData.class);

private JSONObject mData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
import android.util.SparseArray;

import org.mozilla.vrbrowser.ui.widgets.Widget;
import org.mozilla.vrbrowser.utils.SystemUtils;

public class MotionEventGenerator {
static final String LOGTAG = "VRB";
static final String LOGTAG = SystemUtils.createLogtag(MotionEventGenerator.class);
static class Device {
int mDevice;
Widget mPreviousWidget = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.mozilla.vrbrowser.browser.SettingsStore;
import org.mozilla.vrbrowser.search.SearchEngineWrapper;
import org.mozilla.vrbrowser.utils.DeviceType;
import org.mozilla.vrbrowser.utils.SystemUtils;
import org.mozilla.vrbrowser.utils.UrlUtils;

import java.net.URI;
Expand All @@ -40,7 +41,7 @@

public class TelemetryWrapper {
private final static String APP_NAME = "FirefoxReality";
private final static String LOGTAG = TelemetryWrapper.class.getSimpleName();
private final static String LOGTAG = SystemUtils.createLogtag(TelemetryWrapper.class);
private final static int MIN_LOAD_TIME = 40;
private final static int LOADING_BUCKET_SIZE_MS = 100;
private final static int MIN_IMMERSIVE_TIME = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import android.view.View;
import android.view.ViewGroup;

import org.mozilla.vrbrowser.utils.SystemUtils;

public class OffscreenDisplay {
final String LOGTAG = "VRB";
final String LOGTAG = SystemUtils.createLogtag(OffscreenDisplay.class);
private Context mContext;
private int mWidth;
private int mHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.mozilla.vrbrowser.ui.callbacks.BookmarkItemCallback;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import org.mozilla.vrbrowser.utils.AnimationHelper;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.List;
import java.util.Objects;
Expand All @@ -27,7 +28,7 @@

public class BookmarkAdapter extends RecyclerView.Adapter<BookmarkAdapter.BookmarkViewHolder> {

static final String LOGTAG = BookmarkAdapter.class.getSimpleName();
static final String LOGTAG = SystemUtils.createLogtag(BookmarkAdapter.class);

private static final int ICON_ANIMATION_DURATION = 200;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.mozilla.vrbrowser.ui.callbacks.HistoryItemCallback;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import org.mozilla.vrbrowser.utils.AnimationHelper;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.List;
import java.util.Objects;
Expand All @@ -27,7 +28,7 @@

public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.HistoryItemViewHolder> {

static final String LOGTAG = HistoryAdapter.class.getSimpleName();
static final String LOGTAG = SystemUtils.createLogtag(HistoryAdapter.class);

private static final int ICON_ANIMATION_DURATION = 200;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.input.CustomKeyboard;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -23,7 +24,7 @@
import androidx.annotation.Nullable;

public class ChinesePinyinKeyboard extends BaseKeyboard {
private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(ChinesePinyinKeyboard.class);
private CustomKeyboard mKeyboard;
private DBHelper mDB;
private HashMap<String, KeyMap> mKeymaps = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.input.CustomKeyboard;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -24,7 +25,7 @@
import androidx.annotation.Nullable;

public class ChineseZhuyinKeyboard extends BaseKeyboard {
private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(ChineseZhuyinKeyboard.class);
private static final String nonZhuyinReg = "[^ㄅ-ㄩ˙ˊˇˋˉ]";
private CustomKeyboard mKeyboard;
private DBWordHelper mWordDB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.input.CustomKeyboard;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -25,7 +26,7 @@

public class JapaneseKeyboard extends BaseKeyboard {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(JapaneseKeyboard.class);

private CustomKeyboard mKeyboard;
private CustomKeyboard mSymbolsKeyboard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

public class HistoryView extends FrameLayout implements HistoryStore.HistoryListener {

private static final String LOGTAG = HistoryView.class.getSimpleName();
private static final String LOGTAG = SystemUtils.createLogtag(HistoryView.class);

private HistoryBinding mBinding;
private HistoryAdapter mHistoryAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

import org.mozilla.vrbrowser.utils.DeviceType;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.utils.SystemUtils;

import androidx.annotation.Nullable;

public class HoneycombButton extends LinearLayout {

private static final String LOGTAG = "VRB";
private static final String LOGTAG = SystemUtils.createLogtag(HoneycombButton.class);

private ImageView mIcon;
private TextView mText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.ui.widgets.WidgetPlacement;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;
import org.mozilla.vrbrowser.utils.UIThreadExecutor;
import org.mozilla.vrbrowser.utils.UrlUtils;

Expand All @@ -54,7 +55,7 @@

public class NavigationURLBar extends FrameLayout {

private static final String LOGTAG = NavigationURLBar.class.getSimpleName();
private static final String LOGTAG = SystemUtils.createLogtag(NavigationURLBar.class);

private InlineAutocompleteEditText mURL;
private UIButton mMicrophoneButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.mozilla.vrbrowser.ui.keyboards.ChinesePinyinKeyboard;
import org.mozilla.vrbrowser.ui.keyboards.EnglishKeyboard;
import org.mozilla.vrbrowser.utils.StringUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.util.ArrayList;
import java.util.Locale;
Expand All @@ -60,8 +61,6 @@
public class KeyboardWidget extends UIWidget implements CustomKeyboardView.OnKeyboardActionListener, AutoCompletionView.Delegate,
GeckoSession.TextInputDelegate, WidgetManagerDelegate.FocusChangeListener, VoiceSearchWidget.VoiceSearchDelegate, TextWatcher {

private static final String LOGTAG = "VRB";

private static int MAX_CHARS_PER_POPUP_LINE = 10;

private CustomKeyboardView mKeyboardView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import org.mozilla.vrbrowser.ui.views.MediaSeekBar;
import org.mozilla.vrbrowser.ui.views.UIButton;
import org.mozilla.vrbrowser.ui.views.VolumeControl;
import org.mozilla.vrbrowser.utils.SystemUtils;

public class MediaControlsWidget extends UIWidget implements MediaElement.Delegate {

private static final String LOGTAG = "VRB";
private Media mMedia;
private MediaSeekBar mSeekBar;
private VolumeControl mVolumeControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.mozilla.vrbrowser.ui.widgets.dialogs.VoiceSearchWidget;
import org.mozilla.vrbrowser.utils.AnimationHelper;
import org.mozilla.vrbrowser.utils.ServoUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;
import org.mozilla.vrbrowser.utils.UIThreadExecutor;

import java.util.ArrayList;
Expand All @@ -50,8 +51,6 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
SharedPreferences.OnSharedPreferenceChangeListener, SuggestionsWidget.URLBarPopupDelegate,
WindowWidget.BookmarksViewDelegate, WindowWidget.HistoryViewDelegate, TrayListener {

private static final String LOGTAG = NavigationBarWidget.class.getSimpleName();

private AudioEngine mAudio;
private UIButton mBackButton;
private UIButton mForwardButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.browser.Media;
import org.mozilla.vrbrowser.databinding.TitleBarBinding;
import org.mozilla.vrbrowser.utils.SystemUtils;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

public class TitleBarWidget extends UIWidget {

private static final String LOGTAG = TitleBarWidget.class.getSimpleName();

public interface Delegate {
void onTitleClicked(@NonNull TitleBarWidget titleBar);
void onMediaPlayClicked(@NonNull TitleBarWidget titleBar);
Expand Down

0 comments on commit 520e76d

Please sign in to comment.