Skip to content
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

333 use logger in place of print #13

Open
wants to merge 183 commits into
base: 333-use-logger-in-place-of-print
Choose a base branch
from

Conversation

ramonvanalteren
Copy link

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

kcbanner and others added 30 commits May 27, 2010 15:30
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 <[email protected]>
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 <[email protected]>
- 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
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.
bitprophet and others added 30 commits June 23, 2011 17:59
Conflicts:
	fabfile/__init__.py
Conflicts:

	tests/test_network.py
Conflicts:
	tests/test_network.py
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants