-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log capturing researching #403
Comments
Captured stdout/stderr/logging is normally only shown when a test fails. Logging filters allow you specify that some log categories are excluded from being captured (or specifically included). SEE ALSO:
|
I'm having trouble here too. I ideally would like to see the logging interwoven with the step printouts, like: Given thing happens
When some step with logging
INFO:steps:foo bar
Then something else I'm logging from within the step files, e.g.: import logging
log = logging.getLogger('foo')
@step('some step with logging')
def step_impl(context):
log.info('foo bar') I've tried running the feature like: behave --no-logcapture --no-capture I'd also like to see the log output even if everything passes. I find it useful while developing the test suite. Any help would be much appreciated. I'd be happy to have a go with a pull request too, if you can give any pointers. |
@LeoHuckvale OUTPUT-ORDERING: |
@jenisys how to create a mirror of captured logs in separate "debug.log" file? Why follow code does not work with "--junit" argument?
|
@jenisys you say that "Captured stdout/stderr/logging is normally only shown when a test fails." it no good idea and some time logs arrchiving and research on prevoius starting very usful. Could you provide ability always capture errors and stdtout in junit reports? |
@vit1251 What you should do, is to log the stuff you are interested in into a log-file and use it when needed (for doing the research) even when tests pass. This helps you also with long-running tests (that you hopefully not have) to see up to which internal step the system came. But you should be able to do that already by using log-filters for log-categories (excluding them from log-capture mode). |
@jenisys I would like to understand how I can to log into a separate file when the --junit is captured logs and it's killing my settings made in basicConfig. This is the case the principle can be implemented, is it possible to write the logs and use --junit simultaneously or is it mutually exclusive? Logs totally required later after month or year and we can make difference between response and debug information when problem occure around the tests. It very nice knowladge resource. |
@vit1251 SEE ALSO: |
Hello,
I design and implement some scenario with
progress
tag and debugging by write stdout and logging.stdout
capturing work well, but work with logging unpredict:root
logger?The text was updated successfully, but these errors were encountered: