Dear Jonathan and Andrew,
This should help.
I did not realize we can produce JSON log files LOCALLY.
It might be worthwhile to investigate if I can use them for local
debugging. (Problem. of course, is that
I add unstructured dump messages to stderr on the fly during
C++ code debugging. I am not sure how they will picked up by the JSON
summarizer.)
Jonathan's one patch should go a long way for my immediate need temporarily.
Thank you again. I am glad I asked. :-))
Chiaki
On 2022/05/25 22:55, Andrew Halberstadt wrote:
Seems like a reasonable change and looks like Jonathan's suggestion
should work.
Though if parsing logs you almost certainly want to use the raw
structured logs. You can generate these by passing in, e.g `--log-raw
<path/to/file>`. This will generate a JSON lines file where each line
is a JSON object corresponding to the log line in question. We also
upload these files as artifacts in CI for Gecko, e.g:
https://firefoxci.taskcluster-artifacts.net/ROMlTaU1SbauELCGueCH9w/0/public/test_info/mochitest-devtools-chrome_raw.log
You can see the expected format here:
https://firefox-source-docs.mozilla.org/mozbase/mozlog.html#data-format
Hope that helps!
Andrew
On Wed, May 25, 2022 at 8:43 AM Jonathan Kew <[email protected]> wrote:
On 25/05/2022 00:33, ISHIKAWA,chiaki wrote:
> Hi,
>
> I am running TB test suite (mochitest) locally and have an issue
at the
> format of the timestamp of the log lines.
> I am not sure when the time stamp became this way.
> (I don't think I had this issue several years ago. Something
must have
> changed a year or so ago? Maybe around the time, mochitest replaced
> mozmill test.)
>
> Can we modify the test suite run script so that the timestamp
prepended
> to the log line
> always has a filled two digits leading number, 0-filled if
necessary,
> WITHOUT leading space character?
>
> Currently: the log lines when the leading number of the
timestamp is one
> digit, they
> look like the following. Note the space character at the
beginning of
> the line. This causes a problem for simple-minded log summarizer.
>
> 0:23.46 INFO runtests.py | Waiting for browser...
> 0:49.50 GECKO(735766) #01: NS_DebugBreak
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:497)
> 0:49.50 GECKO(735766) #02: nsWindow::SetZIndex(int)
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/widget/gtk/nsWindow.cpp:2470)
> 0:49.50 GECKO(735766) #03: UpdateNativeWidgetZIndexes(nsView*,
int)
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/view/nsView.cpp:505)
>
> I would like it to be: Note there is no leading space character.
>
> 00:23.46 INFO runtests.py | Waiting for browser...
> 00:49.50 GECKO(735766) #01: NS_DebugBreak
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:497)
> 00:49.50 GECKO(735766) #02: nsWindow::SetZIndex(int)
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/widget/gtk/nsWindow.cpp:2470)
> 00:49.50 GECKO(735766) #03: UpdateNativeWidgetZIndexes(nsView*,
int)
> (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/view/nsView.cpp:505)
>
> This formatting would make it much easier for me to create a
script to
> pick up interesting lines and calculate
> the counts from the log.
Try changing %2d to %02d in the format_seconds function at
https://searchfox.org/mozilla-central/rev/9902932742fcdce2c956eeb81fd38350f5394ab2/testing/mozbase/mozlog/mozlog/formatters/machformatter.py#37-40
Hope this helps,
JK
--
You received this message because you are subscribed to the Google
Groups "[email protected]" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:dev-platform%[email protected]>.
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/677b1d6c-d177-0339-fa2e-9de642188d17%40gmail.com.
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/8bf28702-4f75-05fd-fd80-4ebac04db38c%40yk.rim.or.jp.