diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2020-03-11 18:28:46 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-13 11:29:23 +0000 |
commit | b2d55ec1eb7e02579d05b1e1dc0243c33c565420 (patch) | |
tree | 51c5a0eae0dd993a2f45198bafc4c1d48fab2073 /bitbake/lib | |
parent | 25944b82597b6ee6276956831c4c3b67608c8a38 (diff) | |
download | poky-b2d55ec1eb7e02579d05b1e1dc0243c33c565420.tar.gz |
bitbake: knotty: Update hash equivalence logging
Updates hash equivalence logging so that the interesting VERBOSE
messages are always logged to the consolelog file so that issues in
individual user builds can be diagnosed. The autobuilder logging config
then updates this so that they also are shown on stdout, since the
consolelog file is not capture there.
In order to facilitate this, 2 new logging handlers were added,
"BitBake.verbconsole" and "BitBake.verbconsolelog". Neither of these
handlers are attached to anything by default, but they will log any
messages that wouldn't otherwise be logged by the normal console or
consolelog handlers. Users can attach whatever loggers the desire to
this handler to get them to appear on the console or in the consolelog,
as demonstrated by the autobuilderlog.json file.
(Bitbake rev: 766587c0baaaeb5cda3e9454395edbb70e33f756)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 68 |
1 files changed, 60 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 695108a646..24b7a77085 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -419,6 +419,18 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
419 | "stream": "ext://sys.stderr", | 419 | "stream": "ext://sys.stderr", |
420 | "filters": ["BitBake.stderrFilter"], | 420 | "filters": ["BitBake.stderrFilter"], |
421 | }, | 421 | }, |
422 | # This handler can be used if specific loggers should print on | ||
423 | # the console at a lower severity than the default. It will | ||
424 | # display any messages sent to it that are lower than then | ||
425 | # BitBake.console logging level (so as to prevent duplication of | ||
426 | # messages). Nothing is attached to this handler by default | ||
427 | "BitBake.verbconsole": { | ||
428 | "class": "logging.StreamHandler", | ||
429 | "formatter": "BitBake.consoleFormatter", | ||
430 | "level": 1, | ||
431 | "stream": "ext://sys.stdout", | ||
432 | "filters": ["BitBake.verbconsoleFilter"], | ||
433 | }, | ||
422 | }, | 434 | }, |
423 | "formatters": { | 435 | "formatters": { |
424 | # This format instance will get color output enabled by the | 436 | # This format instance will get color output enabled by the |
@@ -442,7 +454,11 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
442 | "BitBake.stderrFilter": { | 454 | "BitBake.stderrFilter": { |
443 | "()": "bb.msg.LogFilterGEQLevel", | 455 | "()": "bb.msg.LogFilterGEQLevel", |
444 | "level": "ERROR" | 456 | "level": "ERROR" |
445 | } | 457 | }, |
458 | "BitBake.verbconsoleFilter": { | ||
459 | "()": "bb.msg.LogFilterLTLevel", | ||
460 | "level": console_loglevel | ||
461 | }, | ||
446 | }, | 462 | }, |
447 | "loggers": { | 463 | "loggers": { |
448 | "BitBake": { | 464 | "BitBake": { |
@@ -455,13 +471,49 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
455 | 471 | ||
456 | # Enable the console log file if enabled | 472 | # Enable the console log file if enabled |
457 | if consolelogfile and not params.options.show_environment and not params.options.show_versions: | 473 | if consolelogfile and not params.options.show_environment and not params.options.show_versions: |
458 | logconfig["handlers"]["BitBake.consolelog"] ={ | 474 | logconfig = bb.msg.mergeLoggingConfig(logconfig, { |
459 | "class": "logging.FileHandler", | 475 | "version": 1, |
460 | "formatter": "BitBake.logfileFormatter", | 476 | "handlers" : { |
461 | "level": "INFO", | 477 | "BitBake.consolelog": { |
462 | "filename": consolelogfile, | 478 | "class": "logging.FileHandler", |
463 | } | 479 | "formatter": "BitBake.logfileFormatter", |
464 | logconfig["loggers"]["BitBake"]["handlers"].append("BitBake.consolelog") | 480 | "level": loglevel, |
481 | "filename": consolelogfile, | ||
482 | }, | ||
483 | # Just like verbconsole, anything sent here will go to the | ||
484 | # log file, unless it would go to BitBake.consolelog | ||
485 | "BitBake.verbconsolelog" : { | ||
486 | "class": "logging.FileHandler", | ||
487 | "formatter": "BitBake.logfileFormatter", | ||
488 | "level": 1, | ||
489 | "filename": consolelogfile, | ||
490 | "filters": ["BitBake.verbconsolelogFilter"], | ||
491 | }, | ||
492 | }, | ||
493 | "filters": { | ||
494 | "BitBake.verbconsolelogFilter": { | ||
495 | "()": "bb.msg.LogFilterLTLevel", | ||
496 | "level": loglevel, | ||
497 | }, | ||
498 | }, | ||
499 | "loggers": { | ||
500 | "BitBake": { | ||
501 | "handlers": ["BitBake.consolelog"], | ||
502 | }, | ||
503 | |||
504 | # Other interesting things that we want to keep an eye on | ||
505 | # in the log files in case someone has an issue, but not | ||
506 | # necessarily show to the user on the console | ||
507 | "BitBake.SigGen.HashEquiv": { | ||
508 | "level": "VERBOSE", | ||
509 | "handlers": ["BitBake.verbconsolelog"], | ||
510 | }, | ||
511 | "BitBake.RunQueue.HashEquiv": { | ||
512 | "level": "VERBOSE", | ||
513 | "handlers": ["BitBake.verbconsolelog"], | ||
514 | } | ||
515 | } | ||
516 | }) | ||
465 | 517 | ||
466 | bb.utils.mkdirhier(os.path.dirname(consolelogfile)) | 518 | bb.utils.mkdirhier(os.path.dirname(consolelogfile)) |
467 | loglink = os.path.join(os.path.dirname(consolelogfile), 'console-latest.log') | 519 | loglink = os.path.join(os.path.dirname(consolelogfile), 'console-latest.log') |