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)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla35
People
(Reporter: davehunt, Assigned: davehunt)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
jgraham
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8487180 -
Flags: review?(james)
Comment 2•10 years ago
|
||
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)
Assignee | ||
Comment 3•10 years ago
|
||
(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)
Updated•10 years ago
|
Attachment #8489422 -
Flags: review?(james) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 4•10 years ago
|
||
Keywords: checkin-needed
Comment 5•10 years ago
|
||
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.
Description
•