333 use logger in place of print#13
Open
ramonvanalteren wants to merge 183 commits intogoosemo:333-use-logger-in-place-of-printfrom
Open
333 use logger in place of print#13ramonvanalteren wants to merge 183 commits intogoosemo:333-use-logger-in-place-of-printfrom
ramonvanalteren wants to merge 183 commits intogoosemo:333-use-logger-in-place-of-printfrom
Conversation
From [issue goosemo#10](http://code.fabfile.org/issues/show/10) I am pulling in the patch and unit tests that he's made. I'll tweak them as needed, but the intial pull looks good.
@ensure_order on a task will side step the use of set() to dedupe, and will instead loop over the host and role lists reappending to temp list if not already present in the temp list. Something to do then as an addition/extension, would be to perhaps add a parameter on the decorator to sort the list.
A simple wrapper around the settings context_manager. Useful for retrofitting old code without having to indent it all for the context block. Signed-off-by: Morgan Goose <morgan.goose@gmail.com>
Signed-off-by: Morgan Goose <morgan.goose@gmail.com>
Both tests assume a env.use_shell to be True. There's a test somewhere else in the chain that can cause this to not be the case. This ensures the assumption is always met. Signed-off-by: Morgan Goose <morgan.goose@gmail.com>
…hinx docs and an example.
…ject-local-dir-doc-update
- I've updated most of the code to match PEP8. There are a few valid exceptions left behind - Note, stripping trailing whitespace from "expecting" strings in test_networks.py will break tests
- Added test for roles and hosts as tuples - Add new decorator for testing @with_patched_state_env to better mock out a full state.env - updated the new tests to use ^^ decorator
…ject-local-dir-doc-update
Addesses issue fabric#117: Add mode support to upload_template() Appears to address fabric#304, Rewrite upload_template to make use of new put() features.
Conflicts: fabric/network.py
Conflicts: fabfile/__init__.py
Conflicts: tests/test_network.py
Conflicts: tests/test_network.py
Fixes fabric#352, fixes fabric#320
Conflicts: AUTHORS
Conflicts: fabric/version.py
* upstream/master: (123 commits) Remove confusing, extraneous note re: example Fix main loop to look for Task.run() Fix up docs.push Update tag list for manually generated docs Task decorator must be first Enhance docs on Task subclass usage Dev version for 1.2 Dev version for 1.1.1 Version bump for 1.0.2 Silly/shitty little sanity-test runner Fixes fabric#345, contains() returns boolean, not retval. Fix I/O race condition Formatting Add test re fabric#329 Add 1.0.2 note to 1.1 release docs Note that 1.0.2 will contain 0.9.7 Fixes fabric#329: reboot() broken for partial host strings Dogfooding: use new-style tasks, namespaces in core fabfile Re fabric#56, don't allow leaf classic modules to pollute new-style trees Use FabricTest to isolate namespace tests ... Conflicts: fabric/main.py fabric/network.py fabric/operations.py
Because logging gets initialized early in the game, mock_streams is not working. The logging output goes to the actual stderr stream and not to the mocked stream.
In some cases there was a mismatch between what was actually printed through the logger and what was expected Some of the testcases swapped expected and actual output In addition there is a fundamental change hidden here: The console logger will output by default to stderr This is probably fine for warn/fatal etc messages, however it is a bit dubious for info messages. In some cases I had to change the stream the testcase got the results from to stdall to get it working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey,
Updated branch to latest master and fixed all testcases.
Remaining issue:
The way the console logger is setup now is to print all output to stderr.
For any logmessages above warning that seems reasonable, however anything of the lower levels should probably go to stdout ?
The only way I can see how to do that is to subclass StreamHandler