Closed Bug 460075 Opened 17 years ago Closed 3 months ago

Consolidate logging, support fine-grained logging

Categories

(Calendar :: General, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
147 Branch

People

(Reporter: dbo, Assigned: mkmelin)

References

Details

Attachments

(6 files)

We currently have at least two logging mechanisms in the code: - calUtils.js' function LOG() - calWcapUtils.js' function log() Moreover we've more and more code logging, bloating the console if calendar.debug.log or calendar.debug.log.verbose is set. This makes it increasingly harder to read the log. I think we need to - consolidate and find a new API - have a look at what stock mozilla platform offers - add support for scoped/fine-grained logging, i.e. that users can switch on logging for specific code areas only, like e.g. "itip, wcap". - add support for file logging (wcap's logging code may be recycled)
Flags: wanted-calendar1.0+
- add support for different log levels, e.g. from 1 (basic) to 5 (verbose) like "itip:5"
See bug 451283 and bug 450631. We're planning on having log4moz available as part of Thunderbird, either as part of log4moz in toolkit or in mailnews.
adding dmose, because i know he cares.
Depends on: 450631
OS: Mac OS X → All
Hardware: x86 → All
Flags: wanted-calendar1.0+ → blocking-calendar1.0+
Whiteboard: [not needed beta][no l10n impact]
I don't think this is a 1.0 blocker.
Agreed, not that important!
Flags: blocking-calendar1.0+
Whiteboard: [not needed beta][no l10n impact]
If this should be of use for calendar and its providers this should depend on bug 451283, shouldn't it? Calendar is not only used in Thunderbird/Lightning but also in Seamonkey and probably others.
See Also: → 716410

Overall, calendar logging should also move over to using console.createInstance, and not be the strange global it is atm. See 944367.
https://searchfox.org/comm-central/rev/a3f0581ca2fcd95e6c32828f583ebfae5487c2ec/calendar/base/modules/calUtils.jsm#47
For getting familiar with the codebase, going through and fixing the logging let's one see a lot.

Severity: normal → S3
grep --exclude-dir={.hg,rust,suite} -rlE 'cal\.LOGverbose' calendar/  | xargs sed -i -E 's#cal.LOGverbose#lazy.log.debug#g'
grep --exclude-dir={.hg,rust,suite} -rlE 'cal\.LOG' calendar/  | xargs sed -i -E 's#cal.LOG#lazy.log.debug#g'

For modules, add their own loggers.
For pure .js files, remove logging.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Attachment #9529636 - Attachment description: Bug 460075 - part6: remove definitions of the old logging releated function, update prefs. r=#thunderbird-reviewers → Bug 460075 - part6: remove definitions of the old logging releated functions, update prefs. r=#thunderbird-reviewers
Attachment #9529632 - Attachment description: Bug 460075 - part2: remove usage of cal.WARN. r=#thunderbird-reviewers → Bug 460075 - part2: remove usage of cal.WARN. r=tobyp
Attachment #9529634 - Attachment description: Bug 460075 - part4: remove usage of cal.STACK. r=#thunderbird-reviewers → Bug 460075 - part4: remove usage of cal.STACK. r=aleca
Attachment #9529635 - Attachment description: Bug 460075 - part5: remove usage of cal.ASSERT. r=#thunderbird-reviewers → Bug 460075 - part5: remove usage of cal.ASSERT. r=aleca
Target Milestone: --- → 147 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/5e158fbf782d
part1: remove usage of cal.LOG and cal.LOGVerbose. r=tobyp
https://hg.mozilla.org/comm-central/rev/6893fc1b9cfc
part2: remove usage of cal.WARN. r=tobyp
https://hg.mozilla.org/comm-central/rev/fd35f2f9f508
part3: remove usage of cal.ERROR. r=tobyp
https://hg.mozilla.org/comm-central/rev/c3e313ded227
part4: remove usage of cal.STACK. r=aleca
https://hg.mozilla.org/comm-central/rev/42233837fadd
part5: remove usage of cal.ASSERT. r=aleca
https://hg.mozilla.org/comm-central/rev/b108c9be4122
part6: remove definitions of the old logging releated functions, update prefs. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Regressions: 2004604
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: