Bug 1771 - Log bitbake console messages by default
Summary: Log bitbake console messages by default
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium enhancement
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard: Patches for this out for review on th...
Depends on:
Blocks:
 
Reported: 2011-11-17 13:40 UTC by Darren Hart
Modified: 2011-11-24 14:20 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Hart 2011-11-17 13:40:08 UTC
When issues arise, a log of the bitbake output is often helpful (not just the logs under the package temp directories). Users don't typically do this, and for hard to reproduce bugs, regenerating a log may not be doable.

I'm using the following script, which I posted to the mailing list here:
https://lists.yoctoproject.org/pipermail/yocto/2011-November/005527.html
where it received some discussion. It seems this sort of thing may generally useful.

#!/bin/bash
TIMESTAMP=$(date -u "+%Y%m%d%H%M%S")
LOG=$(mktemp --suffix=".log" bb-$TIMESTAMP-XXX)
if [ -z "$LOG" ]; then
	echo "ERROR: failed to create log file"
	exit 1
fi

(
	echo "Start: $TIMESTAMP"
	echo "========================================"
	/usr/bin/time 2>&1 -v bitbake $@
	echo "========================================"
	echo "End: $(date -u '+%Y%m%d%H%M%S')"
) | tee $LOG

echo "Logfile: $LOG"
Comment 1 Richard Purdie 2011-11-17 14:48:23 UTC
I think given the log handling code we have in bitbake, we should just mirror the console output to a logfile somewhere in TMPDIR automatically...
Comment 2 Darren Hart 2011-11-17 15:24:48 UTC
(In reply to comment #1)
> I think given the log handling code we have in bitbake, we should just mirror
> the console output to a logfile somewhere in TMPDIR automatically...

That sounds like a good approach to me as well.