Support full logging to file
See original GitHub issueDescription
Outside of any further modifications to the stdout/stderr output controls, it would be very handy to log everything to a file; this would give users another alternate channel for debugging their fabfiles without having to wrestle with what they see at runtime.
Main question is whether to output things as if debug
were set, by default. Thinking to leave it off at first, and have a simple flag/option to turn it on, perhaps --log-debug
.
Where to log to? By default I’d say user’s cwd, though that can get annoying (like “pipturds”, i.e. pip-log.txt
files that pip drops everywhere.) Unfortunately there’s no other great standard location, so perhaps turn logging-to-file off by default? Either way, allow override, say via --log-location
or similar.
Unsure whether it makes any sense to utilize the logging
module’s concept of levels; the only place I can see it being useful at all is for the debug stuff, but we currently think of debugging as modifying output instead of adding to it – which doesn’t mesh with how logging
works. So possibly best to just stick everything in, say, INFO for now, then tweak later if necessary.
Potential modules:
- stdlib
logging
- Pros: stdlib, well known/documented
- Cons: kind of byzantine/complicated to use
- Logbook
- Pros: Armin
- Twiggy
- Others?
Originally submitted by Jeff Forcier (bitprophet) on 2009-09-06 at 10:57am EDT
Relations
- Related to #101: ANSI Color support
- Duplicated by #135: All output should be sent through logging module
- Related to #151: Make fabfile print() statements controllable via output controls
- Related to #163: Formattable output prefix.
- Related to #244: Add additional, verbose-only output when connecting
- Related to #71: Consider adding “global”/per-task capture of run/sudo/local stdout/stderr
- Duplicated by #333: Use logger() instead of print()
Issue Analytics
- State:
- Created 12 years ago
- Comments:31 (7 by maintainers)
Top GitHub Comments
Sorry for replying a closed issue. I am using https://github.com/algrebe/python-tee to redirect stdout to a file. Hope this project can help others.
Rolling this into pyinvoke/invoke#15, updated its desc with a bunch of thoughts too.