Closed Bug 1632303 Opened 9 months ago Closed 8 months ago

Replace search service logging with console.createInstance

Categories

(Firefox :: Search, task, P3)

task
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 79
Iteration:
79.1 - June 1 - June 14
Tracking Status
firefox79 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(2 files)

I've just found out that we can replace our current logging with a console wrapper, that allows different log levels.

We could do something like:

  this._log = console.createInstance({
    prefix: "SearchService",
    maxLogLevel: "Warn",
  });

This gives us a prefixed log, line number information and fully compatible console.log output so that we can e.g. output objects to the console and have them able to be inspected.

Severity: -- → N/A
Assignee: nobody → standard8
Iteration: --- → 79.1 - June 1 - June 14

I've done a first pass here and tried to clean up what's sensible to do so, I think we should be prepared to reduce logging/clean up more in the future if it makes sense, it is probably worth watch as we move forward.

I have used different levels of logging where I feel it is appropriate, adding more warn/errors that we didn't have the capability for before.

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a0feb5361c9
Replace SearchUtils.log with console.createInstance. r=daleharvey
https://hg.mozilla.org/integration/autoland/rev/dd60c4a35ba7
Replace SearchUtils.fail with direct throws. r=daleharvey
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.