* [PATCH 0/1] Allow set +x for shell functions to be configured
@ 2012-02-27 14:11 Paul Eggleton
2012-02-27 14:11 ` [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS Paul Eggleton
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-02-27 14:11 UTC (permalink / raw)
To: bitbake-devel
A patch to allow the addition of "set +x" to be controlled via
configuration.
The patch (against Poky, but applies cleanly with -p2 against bitbake
master) is available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/bbverboselogs
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bbverboselogs
Paul Eggleton (1):
bitbake: implement BB_VERBOSE_LOGS
bitbake/lib/bb/build.py | 3 ++-
bitbake/lib/bb/cooker.py | 4 ++++
bitbake/lib/bb/msg.py | 3 +++
3 files changed, 9 insertions(+), 1 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS
2012-02-27 14:11 [PATCH 0/1] Allow set +x for shell functions to be configured Paul Eggleton
@ 2012-02-27 14:11 ` Paul Eggleton
2012-02-27 16:04 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-02-27 14:11 UTC (permalink / raw)
To: bitbake-devel
Enable configuring whether "set +x" is added to all shell tasks rather
than forcing it; this is enabled by setting BB_VERBOSE_LOGS to 1.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
bitbake/lib/bb/build.py | 3 ++-
bitbake/lib/bb/cooker.py | 4 ++++
bitbake/lib/bb/msg.py | 3 +++
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index e85d7c4..37686f8 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -221,9 +221,10 @@ def exec_func_shell(function, d, runfile, cwd=None):
with open(runfile, 'w') as script:
script.write('#!/bin/sh -e\n')
+ if bb.msg.loggerVerboseLogs:
+ script.write("set -x\n")
data.emit_func(function, script, d)
- script.write("set -x\n")
if cwd:
script.write("cd %s\n" % cwd)
script.write("%s\n" % function)
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 12b526b..d3bdd17 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -206,6 +206,10 @@ class BBCooker:
def parseConfiguration(self):
+ # Set log file verbosity
+ verboselogs = bb.utils.to_boolean(self.configuration.data.getVar("BB_VERBOSE_LOGS", "0"))
+ if verboselogs:
+ bb.msg.loggerVerboseLogs = True
# Change nice level if we're asked to
nice = self.configuration.data.getVar("BB_NICE_LEVEL", True)
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 20d9bdd..9b39325 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -100,6 +100,7 @@ class BBLogFilter(object):
loggerDefaultDebugLevel = 0
loggerDefaultVerbose = False
+loggerVerboseLogs = False
loggerDefaultDomains = []
def init_msgconfig(verbose, debug, debug_domains = []):
@@ -108,6 +109,8 @@ def init_msgconfig(verbose, debug, debug_domains = []):
"""
bb.msg.loggerDefaultDebugLevel = debug
bb.msg.loggerDefaultVerbose = verbose
+ if verbose:
+ bb.msg.loggerVerboseLogs = True
bb.msg.loggerDefaultDomains = debug_domains
def addDefaultlogFilter(handler):
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS
2012-02-27 14:11 ` [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS Paul Eggleton
@ 2012-02-27 16:04 ` Richard Purdie
2012-02-28 13:29 ` Paul Eggleton
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2012-02-27 16:04 UTC (permalink / raw)
To: Paul Eggleton; +Cc: bitbake-devel
On Mon, 2012-02-27 at 14:11 +0000, Paul Eggleton wrote:
> Enable configuring whether "set +x" is added to all shell tasks rather
> than forcing it; this is enabled by setting BB_VERBOSE_LOGS to 1.
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
> bitbake/lib/bb/build.py | 3 ++-
> bitbake/lib/bb/cooker.py | 4 ++++
> bitbake/lib/bb/msg.py | 3 +++
> 3 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
> index e85d7c4..37686f8 100644
> --- a/bitbake/lib/bb/build.py
> +++ b/bitbake/lib/bb/build.py
> @@ -221,9 +221,10 @@ def exec_func_shell(function, d, runfile, cwd=None):
>
> with open(runfile, 'w') as script:
> script.write('#!/bin/sh -e\n')
> + if bb.msg.loggerVerboseLogs:
> + script.write("set -x\n")
> data.emit_func(function, script, d)
>
> - script.write("set -x\n")
> if cwd:
> script.write("cd %s\n" % cwd)
Looks good to me but could I suggest one small tweak - position the set
-x after data.emit_func()?
The reason being that having lines of output for each line in the run.*
file is generally painful and it makes more sense to start tracing only
when we start executing the function we care about.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS
2012-02-27 16:04 ` Richard Purdie
@ 2012-02-28 13:29 ` Paul Eggleton
0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2012-02-28 13:29 UTC (permalink / raw)
To: bitbake-devel
On Monday 27 February 2012 16:04:17 Richard Purdie wrote:
> On Mon, 2012-02-27 at 14:11 +0000, Paul Eggleton wrote:
> > diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
> > index e85d7c4..37686f8 100644
> > --- a/bitbake/lib/bb/build.py
> > +++ b/bitbake/lib/bb/build.py
> >
> > @@ -221,9 +221,10 @@ def exec_func_shell(function, d, runfile, cwd=None):
> > with open(runfile, 'w') as script:
> > script.write('#!/bin/sh -e\n')
> >
> > + if bb.msg.loggerVerboseLogs:
> > + script.write("set -x\n")
> >
> > data.emit_func(function, script, d)
> >
> > - script.write("set -x\n")
> >
> > if cwd:
> > script.write("cd %s\n" % cwd)
>
> Looks good to me but could I suggest one small tweak - position the set
> -x after data.emit_func()?
>
> The reason being that having lines of output for each line in the run.*
> file is generally painful and it makes more sense to start tracing only
> when we start executing the function we care about.
OK, will send a v2 shortly.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/1] Allow set +x for shell functions to be configured
@ 2012-02-27 14:06 Paul Eggleton
0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggleton @ 2012-02-27 14:06 UTC (permalink / raw)
To: bitbake-devel
A patch to allow the addition of "set +x" to be controlled via
configuration.
The patch (against Poky, but applies cleanly with -p2 against bitbake
master) is available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/bbverboselogs
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bbverboselogs
Paul Eggleton (1):
bitbake: implement BB_VERBOSE_LOGS
bitbake/lib/bb/build.py | 3 ++-
bitbake/lib/bb/cooker.py | 4 ++++
bitbake/lib/bb/msg.py | 5 ++++-
3 files changed, 10 insertions(+), 2 deletions(-)
--
1.7.5.4
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-28 13:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-27 14:11 [PATCH 0/1] Allow set +x for shell functions to be configured Paul Eggleton
2012-02-27 14:11 ` [PATCH 1/1] bitbake: implement BB_VERBOSE_LOGS Paul Eggleton
2012-02-27 16:04 ` Richard Purdie
2012-02-28 13:29 ` Paul Eggleton
-- strict thread matches above, loose matches on Subject: below --
2012-02-27 14:06 [PATCH 0/1] Allow set +x for shell functions to be configured Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.