Color Weave logs to help find errors, engine problems, etc.

RESOLVED FIXED in 0.3

Status

enhancement
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: anubeon, Assigned: Mardak)

Tracking

unspecified
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2
Build Identifier: Weave 0.2.105

It would be of considerable utility, especially for bug reporting, if error messages within the verbose log were highlighted against the background of nominal messages. It is often difficult for we laymen to identify were the verbose error message begins and ends or indeed to locate the verbose error message in the first place.

I realise that the ultimate goal is to build a GUI error notification system (for end-users) but such notifications are likely to provide minimal information and support requests and/or bug reports would be best served by verbose messages would they not?

Regards,

Lee.

Reproducible: Always

Steps to Reproduce:
N/A
Actual Results:  
N/A

Expected Results:  
N/A

N/A
Assignee

Comment 1

10 years ago
Not sure what you mean by "syntax highlighting" but we can definitely color the logs by log source and severity. Would be useful for general hacking/debugging. :)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee

Comment 2

10 years ago
Posted image screenshot of v1
Yay colors! Automatically generate a background color for each log source so new engines can get colored differently. I've hardcoded various colors for different logging levels. The common ones are color variants of darker blackish and warn/error/fatal are deeper shades of orange to red.
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Assignee

Updated

10 years ago
Summary: REQUEST: Syntax highlighting of error messages within Weaves verbose log. → Color Weave logs to help find errors, engine problems, etc.
Reporter

Comment 3

10 years ago
That is precisely what I meant. I suppose the term 'syntax highlighting' is a
misnomer; 'error highlighting' is probably more apt.

In relation to the screen-shot you've uploaded; I would suggest using brighter
shades of red and/or amber to further contrast the duller colours associated
with then background of nominal messages. Just a thought. :)

Lee.

(In reply to comment #2)
> Created an attachment (id=364700) [details]
> screenshot of v1
> 
> Yay colors! Automatically generate a background color for each log source so
> new engines can get colored differently. I've hardcoded various colors for
> different logging levels. The common ones are color variants of darker blackish
> and warn/error/fatal are deeper shades of orange to red.
Assignee

Comment 4

10 years ago
http://hg.mozilla.org/labs/weave/rev/924831f17c98

The logs are now shown in reverse chronological order and the logger will now pad source "logger names" to 20 spaces to help align the rest of the columns.

We can adjust colors later. :)
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Target Milestone: -- → 0.3
Version: unspecified → Trunk
Assignee

Comment 5

10 years ago
(In reply to comment #3)
> using brighter shades of red and/or amber to further contrast
FYI, I didn't have any warning or error messages shown, but they're pretty red when they do appear. Well.. warn is pretty orange...

But here's the list of colors, so it's easy to change.

http://hg.mozilla.org/labs/weave/rev/924831f17c98#l27
      27 +    // Define some colors for various levels/types of logging
      28 +    let textColors = {
      29 +      WARN:   "#f90",
      30 +      ERROR:  "#f30",
      31 +      FATAL:  "#f00",
      32 +
      33 +      CONFIG: "#600",
      34 +      DEBUG:  "#060",
      35 +      INFO:   "#006",
      36 +      TRACE:  "#066",
      37 +    };
Reporter

Comment 6

10 years ago
Yes, I noticed that after posting. Kudos on the decision to highlight different engines; you've really gone above and beyond! Now I'll leave you wise-god-like-programmer-type-people to do what you do best. :D

TTFN,
Lee.

(In reply to comment #5)
> (In reply to comment #3)
> > using brighter shades of red and/or amber to further contrast
> FYI, I didn't have any warning or error messages shown, but they're pretty red
> when they do appear. Well.. warn is pretty orange...
> 
> But here's the list of colors, so it's easy to change.
> 
> http://hg.mozilla.org/labs/weave/rev/924831f17c98#l27
>       27 +    // Define some colors for various levels/types of logging
>       28 +    let textColors = {
>       29 +      WARN:   "#f90",
>       30 +      ERROR:  "#f30",
>       31 +      FATAL:  "#f00",
>       32 +
>       33 +      CONFIG: "#600",
>       34 +      DEBUG:  "#060",
>       35 +      INFO:   "#006",
>       36 +      TRACE:  "#066",
>       37 +    };
Nice, but this makes the log viewer pretty slow.  Maybe we should just tweak the logfile rotation prefs to keep them smaller.

I also think this code should be better integrated into log4moz.  I'd like coloring for the dump appender too (using ansi terminal codes) :-)
Assignee

Comment 8

10 years ago
(In reply to comment #7)
> Nice, but this makes the log viewer pretty slow.  Maybe we should just tweak
> the logfile rotation prefs to keep them smaller.
Slow as in to show all the lines? I have each line displayed on a timeout. And it's sorted by reverse time order, so you'll likely only need to see the top. But this could be easily fixed to process more than one line at a time.

Or do you mean it slows things down because there's so many lines to display?

> I also think this code should be better integrated into log4moz.
Aww.. no more iframe-fake-ajax data loading? I suppose technically I could have just read in each line one at a time directly instead of doing it ajaxy... ;)
(In reply to comment #8)
> Slow as in to show all the lines? I have each line displayed on a timeout. And
> it's sorted by reverse time order, so you'll likely only need to see the top.
> But this could be easily fixed to process more than one line at a time.

Oh!  I didn't realize you'd inverted the order, I was scrolling down waiting for it to finish loading ;-)

So it's pretty good as-is, then.

> > I also think this code should be better integrated into log4moz.
> Aww.. no more iframe-fake-ajax data loading? I suppose technically I could have
> just read in each line one at a time directly instead of doing it ajaxy... ;)

No, I meant that the information you're parsing out using a regex is dependent on the log4moz formatter, and that in fact I'd like to have a formatter that outputs ansi color codes so I can get colors in the terminal.

The Tb team wrote an XML formatter that (I think) uses some standard log4j syntax, and they can use an Apache log viewer:

http://www.visophyte.org/blog/2008/10/20/log4moz-and-chainsaw-via-new-xmlformattersocketappender/

They have a JSON formatter too:

http://www.visophyte.org/blog/2008/12/14/logsploder-logsploding-its-way-to-your-logs-soon-also-logsplosion/

But I think what we have now (with your current coloring) is fine.  I'm not sure how much faster I'd be able to debug if I had some of this other stuff integrated in, but my guess is not much.

Comment 10

10 years ago
Please, add checkbox on log window to immediately swich this on and off. 
This feature makes log window on a large detail log sooooooooo slooooooooooow...
The log is now sorted with the latest at the top, so it doesn't really matter how long it takes to load...

But I do admit, that after using it a few times, I don't find it super usable, and when people copy and paste from there it's very confusing that the log is "backwards".
Assignee

Updated

10 years ago
Blocks: 482908
Component: Weave → General
Product: Mozilla Labs → Weave
Version: Trunk → unspecified
QA Contact: weave → general
You need to log in before you can comment on or make changes to this bug.