mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 05:26:23 +00:00
launcher: Limit copies of massive debug logs in markdown file
When debugging is activated, we could end up with log files ranging in the multi-megabyte or even gigabyte range. Copying those is expensive from a cpu/io point of view in addition to clobbering the storage. Instead of always copying those files, check if they are smaller than 500kB. If not, don't copy them and instead provide a link to their location. Fixes #52 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/203>
This commit is contained in:
parent
124153fe06
commit
2dd165b4ec
1 changed files with 10 additions and 3 deletions
|
@ -246,9 +246,16 @@ class Test(Loggable):
|
|||
if not self.options.redirect_logs:
|
||||
self.out.flush()
|
||||
for logfile in self.extra_logfiles:
|
||||
self.out.write('\n\n## %s:\n\n```\n%s\n```\n' % (
|
||||
os.path.basename(logfile), self.get_extra_log_content(logfile))
|
||||
)
|
||||
# Only copy over extra logfile content if it's below a certain threshold
|
||||
# Avoid copying gigabytes of data if a lot of debugging is activated
|
||||
if os.path.getsize(logfile) < 500 * 1024:
|
||||
self.out.write('\n\n## %s:\n\n```\n%s\n```\n' % (
|
||||
os.path.basename(logfile), self.get_extra_log_content(logfile))
|
||||
)
|
||||
else:
|
||||
self.out.write('\n\n## %s:\n\n**Log file too big.**\n %s\n\n Check file content directly\n\n' % (
|
||||
os.path.basename(logfile), logfile)
|
||||
)
|
||||
|
||||
if self.rr_logdir:
|
||||
self.out.write('\n\n## rr trace:\n\n```\nrr replay %s/latest-trace\n```\n' % (
|
||||
|
|
Loading…
Reference in a new issue