Bug 972648
Summary: | [RFE] Prefix log/assert messages called from beakerlib libraries | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Kutálek <dkutalek> |
Component: | beakerlib | Assignee: | Dalibor Pospíšil <dapospis> |
Status: | ASSIGNED --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | azelinka, lzachar, mkyral, ohudlick, qa-errata-list |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | Project: Easy | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1208577 |
Description
David Kutálek
2013-06-10 10:35:43 UTC
Please note that the code above for prefix setting is over simplified and not completely correct. In fact, BASH_SOURCE array have to be iterated to find out first possible lib.sh occurrence. I like the idea, but I would like to see the real library owner in the output, in other words to respect nested library calls. You usually want to know the details about failed assert so the knowledge of the top library will not help you that much. It is true that nested calls are not that common (yet) but I think some wrapper library to get apache+mariadb+php server running might become valid use case. IMHO journal could add the closest function name to the log in the format same in the description, based on some control envar. If this envar is switched on by first (any) rlImport call, the consequent logs will get the full report format. If one want to get the full format for logs before rlImport it should be enough to set the variable manually. I added to my library some prefixing long time ago. I'm interesting for your opinion about form of prefixing because my implementation show all stack for a given assert. :: [ PASS ] :: postgresqlUDB->rlRun->postgresqlCreateDB: Internal assert (Expected 0, got 0) :: [ PASS ] :: postgresqlUDB: Internal assert (Expected 0, got 0) :: [ PASS ] :: postgresqlUDB->rlRun->postgresqlAddUser: Internal assert (Expected 0, got 0) :: [ PASS ] :: postgresqlUDB: Internal assert (Expected 0, got 0) :: [ PASS ] :: postgresqlUDB: Internal assert (Expected 0, got 0) I'm open to suggestions. I like the full stack approach Me too This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. The full stack is nice but I would prefer it only in DEBUG mode. Currently beakerlib since v1.9-3 produces something like: # rlRun "postgresqlDropDB test" generates :: [ BEGIN ] :: Running 'postgresqlDropDB test' (Expected 0, got 127) :: [ FAIL ] :: Running 'postgresqlQuery template1 'DROP DATABASE \\\"test\\\";'' (Expected 0, got 127) :: [ FAIL ] :: Command 'postgresqlDropDB test' (Expected 0, got 127) With tcfRun from library library(distribution/tcf) you can get :: [ BEGIN ] :: Running 'postgresqlDropDB test' (Expected 0, got 127) :: [ FAIL ] :: Running 'postgresqlQuery template1 'DROP DATABASE \\\"test\\\";'' (Expected 0, got 127) :: [ FAIL ] :: Running 'postgresqlDropDB test' (Expected 0, got 127) Sometimes the stack can be really big and I think it could produce very long lines so the orientation would be again hard. If we do not print all stack how would we handle nested calls though more libraries? We decided to not change default behaviour but add this kind of logging conditionally on some configuration. I'm adding this bug ass blocker to tracking bug where we can discus format of enabling these features. |