XCLogParser icon indicating copy to clipboard operation
XCLogParser copied to clipboard

xclogparser parses the second to the latest .xcactivitylog

Open yongjincho92 opened this issue 4 years ago • 2 comments

As noted in the README for XCLogParser, .xcactivitylog file is generated a few seconds after the build action is completed. I added the xclogparser parse command into the build's post action and what I see is that the xclogparser parses the xcactivitylog for the second to the latest build log.

I am using Xcode 12.5.1 and I am not sure if this is by design or a bug. Can someone also confirm that adding xclogparser as the post build action is guaranteed to wait for the latest .xcactivitylog file to be generated and then parse it?

yongjincho92 avatar Sep 16 '21 18:09 yongjincho92

Hi! No, XCLogParser doesn't retry if .xcactivitylog is invalid.

For your scenario with post build action, you can use XCMetrics, which actually validates .xcactivitylog and retries if is not ready yet:

https://github.com/spotify/XCMetrics/blob/0f449cc9dc328de3fcd85e08edec18f43da3a041/Sources/XCMetricsClient/Log%20Management/LogManager.swift#L128-L155

polac24 avatar Sep 16 '21 20:09 polac24

...am using Xcode 12.5.1 and I am not sure if this is by design or a bug.

I can reproduce the same with Xcode Version 13.3 (13E113)

Adding something along the lines of sleep 5; before executing xclogparser... in the post-build section does not work either.

dezinezync avatar Apr 05 '22 03:04 dezinezync

Closing since the original question is answered

PatrikBillgren avatar Nov 28 '22 13:11 PatrikBillgren