Closed Bug 1914469 Opened 1 year ago Closed 1 year ago

Cleanup Log.verbose getter

Categories

(Remote Protocol :: Agent, task, P3)

task
Points:
1

Tracking

(firefox132 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

(Whiteboard: [webdriver:m12])

Attachments

(1 file)

Spotted while looking at Bug 1914413.

https://searchfox.org/mozilla-central/rev/f6fa2fdaed58ece12d4c6bc95dc5901ec22a4d05/remote/shared/Log.sys.mjs#76-81

static get verbose() {
  // we can't use Preferences.sys.mjs before first paint,
  // see ../browser/base/content/test/performance/browser_startup.js
  const level = Services.prefs.getStringPref(PREF_REMOTE_LOG_LEVEL, "Info");
  return StdLog.Level[level] >= StdLog.Level.Info;
}

There are several issues here:

  • we can't use Preferences.sys.mjs this is an outdated comment, the rest of the module no longer uses this
  • getStringPref -> should use getCharPref
  • but we should actually just use the lazy pref getter already available in the module. The separate logic was relevant when the module was using several prefs, but they have all been merged under "remote.log.level" now (even if I think in the long run we should just introduce another pref for this, see Bug 1828395)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Points: --- → 1
Priority: -- → P3
Whiteboard: [webdriver:m12]
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/860054713044 [remote] Reuse the logLevel lazy getter to compute Log.verbose r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: