This page is a high level account of the structured logging project providing links to further information about the project.
Background and Motivation
- Support a range of output formats for test results
- Eliminate need for complex and brittle regex based log parsing
- Consolidate output processing and logging configuration
- Establish a common data format for test results and test harness diagnostics
- Populate data format in-harness with a logging API designed to output this format
- Log data from test harnesses as JSON rather than formatted strings
- Producer test framework (Firefox/Fennec/B2G - JS/Java)
- Test harness (Python/JS)
The primary logging API for our data format is mozlog's structured module (readthedocs). An extensive example of how to use the api is included in these docs.
Mozlog is a module in Mozbase. More information about contributing to Mozbase can be found on its wiki page: https://wiki.mozilla.org/Auto-tools/Projects/MozBase#Working_on_Mozbase_and_Contributing_Patches
24 Total; 24 Open (100%); 0 Resolved (0%); 0 Verified (0%);
- The tracking bug for this effort is bug916295.
Structured Logging FAQ
What does this mean for you? It’s been a goal of the implementation effort to provide a foundation for future tools and infrastructure improvements without disrupting familiar workflows or breaking compatibility with existing tools, so the changes will be largely unobtrusive at this stage. However, there are two things to keep in mind:
- Support for failing a build/test job by logging “TEST-UNEXPECTED-“ directly will be diminished as we move away from regex parsing in our tools. Please do not add instances of this when something else is available.
- As we roll out this out to the various harnesses you may notice different output formats than you expected. Changes to formatting shouldn’t make logs any less useful — if they have, this is probably an unintended effect of the implementation and you should file a bug (Testing :: Mozbase for mozlog features/bugs). To get output closer to what you used to see, you should be able to pass “—log-tbpl -“ to mach to specify a formatter implementing the legacy log format.