Auto-tools/Projects/Structured Logging: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 33: Line 33:
== Structured Logging FAQ ==
== Structured Logging FAQ ==


* I'm not seeing the output I expect, what gives?
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:
** Output for common use cases should be no less informative than it once was. You may have encountered an unintended effect of the implementation that should be addressed.
 
* How can I change the format of log output?
* 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.
** For test harnesses logging through mozlog and their respective mach targets, you can pass in commandline arguments of the form "--log-<format>=<file>". Common formats are "mach", a concise format intended to be readable, "raw", the JSON structured format intended for post-processing, and "tbpl", a format designed to maintain compatibility with legacy tools hand-parsing our logs.
* 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 it has, this is probably an unintended effect of the implementation and you should file a bug (usually in Testing :: Mozbase for formatter bugs/features). 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.
* Can't I just log "TEST-UNEXPECTED-FAIL"?
** If you have been relying on logging the string "TEST-UNEXPECTED-FAIL" directly to provide test coverage, this will do what you expect for the time being, but future support may be diminished.
Confirmed users
64

edits