Closed Bug 1065375 Opened 10 years ago Closed 10 years ago

[mozlog] HTML structured log formatter does not include stack trace

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla35

People

(Reporter: davehunt, Assigned: davehunt)

References

Details

Attachments

(1 file, 1 obsolete file)

The current HTML formatter does not include the stack trace, which makes it unsuitable to replace the HTML report generated by the Marionette test runner.
Blocks: 1065410
Comment on attachment 8487180 [details] [diff] [review] Add stack track to HTML structured log formatter. v1.0 Review of attachment 8487180 [details] [diff] [review]: ----------------------------------------------------------------- I think this needs a little fixup. I'm also not sure if it formats things in quite the way you want; did you test it? ::: testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py @@ +96,5 @@ > except: > pass > > log = html.div(class_='log') > + output = data.get('stack', '') + data.get('message', '') This seems to assume that the stacktrace always ends in a newline; I can't see immediately why that would be true. Better to make a list of all the lines you want like: output = data.get('stack', '').splitlines() + data.get('message', '').splitlines()
Attachment #8487180 - Flags: review?(james)
(In reply to James Graham [:jgraham] from comment #2) > Comment on attachment 8487180 [details] [diff] [review] > Add stack track to HTML structured log formatter. v1.0 > > Review of attachment 8487180 [details] [diff] [review]: > ----------------------------------------------------------------- > > I think this needs a little fixup. I'm also not sure if it formats things in > quite the way you want; did you test it? Yes, I tested it with a simple assertion failure and it was giving identical output to the HTML formatter provided by the Marionette test runner. > ::: testing/mozbase/mozlog/mozlog/structured/formatters/html/html.py > @@ +96,5 @@ > > except: > > pass > > > > log = html.div(class_='log') > > + output = data.get('stack', '') + data.get('message', '') > > This seems to assume that the stacktrace always ends in a newline; I can't > see immediately why that would be true. Better to make a list of all the > lines you want like: > > output = data.get('stack', '').splitlines() + data.get('message', > '').splitlines() I was also surprised that there was a newline at the end of the stack trace. That said, I like your idea of ensuring that we're not relying on it.
Attachment #8487180 - Attachment is obsolete: true
Attachment #8489422 - Flags: review?(james)
Attachment #8489422 - Flags: review?(james) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: