On 6/3/14, 6:16 AM, Mike de Boer wrote:
Writing wrappers in python around things to improve the current situation like
a band-aid isn’t the way I’m used to fix things; I like to take the bull by the
horns[1]
I’d like to ask _why_ structured logging needs to be bolted on top of what we
have currently? Is it more work to fix the real problem? Are we less
comfortable doing things in JS?
"Structured logging" is a fancy way of saying "machine readable output."
The goal of structured logging is to facilitate machine readable output
from our automation. The goal of machine readable output is to enable
better result viewing, reports, dashboards, etc.
Currently, we have a single stream of output that is read by both humans
and machines. By catering to both consumers, we've produced output that
is inefficient for both. As a human, you hate having to sift through
dozens of lines of context to arrive at the meat. As a computer (or a
human programming a computer), you hate having to parse logs/strings
because it is slow, cumbersome, and fragile. Please read [1] for more
context.
The goal being worked towards is to have two output streams: 1 optimized
for humans and 1 optimized for machines. Since most of our test
harnesses have Python underneath, it makes sense to send machine
readable output from JavaScript/Gecko to Python and have Python "fork"
the stream into human and machine optimized versions (as opposed to
sending 2 streams to Python and maintaining dual output streams in each
test flavor, which is more effort to maintain).
Doing things in Python also has the advantage that the debugging,
testing, and standard library environment is more mature than JavaScript
(though the scales are shifting towards JS). Things like process
management are so much easier in Python. We could write more things in
JavaScript, sure. But we'd be creating more work for ourselves. At the
end of the day, I argue our effort is better spent providing products
like Firefox and Firefox OS, not advance the state of JavaScript
automation. Would advancing JavaScript automation be a noble goal, sure.
But I think the path of least resistance wins out here. And right now
that path means Python over JavaScript (at least for existing automation).
[1]
http://gregoryszorc.com/blog/2012/12/06/thoughts-on-logging---part-1---structured-logging/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform