Closed Bug 1415318 Opened 7 years ago Closed 6 years ago

Enable GeckoView to send console.log to logcat

Categories

(GeckoView :: General, enhancement, P2)

enhancement

Tracking

(firefox62 wontfix, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox62 --- wontfix
firefox63 --- fixed

People

(Reporter: rbarker, Assigned: snorp)

References

Details

(Whiteboard: [geckoview:fxr])

Attachments

(2 files)

Currently console.log messages are not visible in GeckoView. Enable sending them to the logcat.
Assignee: nobody → rbarker
Attachment #8926097 - Flags: feedback?
Attachment #8926097 - Flags: feedback? → feedback?(snorp)
Comment on attachment 8926097 [details]
Bug 1415318 - Enable GeckoView to send console.log to logcat

https://reviewboard.mozilla.org/r/197324/#review219726

I think we should make this an opt-in feature from the app -- capturing console output can be a performance burden.
Attachment #8926097 - Flags: review-
Assignee: rbarker → nobody
Whiteboard: [geckoview:fxr]
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #2)
> Comment on attachment 8926097 [details]
> Bug 1415318 - Enable GeckoView to send console.log to logcat
> 
> https://reviewboard.mozilla.org/r/197324/#review219726
> 
> I think we should make this an opt-in feature from the app -- capturing
> console output can be a performance burden.

I had changed my mind about this, but Randall reminded me that this might be easy via a GeckoRuntimeSetting, so I'll revise the patch to use that.
Comment on attachment 8984603 [details]
Bug 1415318 - Optionally send web console output to logcat in GeckoView

https://reviewboard.mozilla.org/r/250472/#review256854
Attachment #8984603 - Flags: review?(rbarker) → review+
Comment on attachment 8984603 [details]
Bug 1415318 - Optionally send web console output to logcat in GeckoView

https://reviewboard.mozilla.org/r/250472/#review256932

::: mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java:284
(Diff revision 2)
>      /* package */ Pref<Integer> mCookieLifetimeDays = new Pref<Integer>(
>          "network.cookie.lifetime.days", 90);
>      /* package */ Pref<String> mTrackingProtection = new Pref<String>(
>          "urlclassifier.trackingTable", "");
> +    /* package */ Pref<Boolean> mConsoleOutput = new Pref<Boolean>(
> +            "geckoview.console.enabled", false);

Alignment

::: mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java:292
(Diff revision 2)
>      /* package */ boolean mJavaCrashReporting;
>      /* package */ boolean mDebugPause;
>  
>      private final Pref<?>[] mPrefs = new Pref<?>[] {
>          mCookieBehavior, mCookieLifetime, mCookieLifetimeDays, mJavaScript,
> -        mRemoteDebugging, mTrackingProtection, mWebFonts
> +        mRemoteDebugging, mTrackingProtection, mWebFonts, mConsoleOutput

Alphabetize

::: mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java:605
(Diff revision 2)
> +    /**
> +     * Get whether or not web console messages are sent to logcat.
> +     *
> +     * @return This GeckoRuntimeSettings instance.
> +     */
> +    public @NonNull boolean getConsoleOutputEnabled() {

`@NonNull` doesn't make sense here.

::: mobile/android/modules/geckoview/GeckoViewConsole.jsm:26
(Diff revision 2)
> +
> +  get enabled() {
> +    return this._isEnabled;
> +  },
> +
> +  set enabled(val) {

aVal
Attachment #8984603 - Flags: review?(nchen) → review+
Pushed by jwillcox@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8904c9386abf
Optionally send web console output to logcat in GeckoView r=jchen,rbarker
https://hg.mozilla.org/mozilla-central/rev/8904c9386abf
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Assignee: nobody → snorp
This is a debug feature. We don't need to uplift to Beta 62.
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 63 → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: