diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-19 22:47:37 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-19 22:47:37 -0400 |
commit | b0168bef1eedbe75ffab364a02a0c1ba8466dbd1 (patch) | |
tree | 2e6e55f4ee80001dc5c856b3a416c89c5da712d0 /coverage/control.py | |
parent | badfb167150938ad5e1f28920e5846ffe1e10e23 (diff) | |
download | python-coveragepy-git-b0168bef1eedbe75ffab364a02a0c1ba8466dbd1.tar.gz |
Added more debugging controls, especially for data operations
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py index fde6f63b..050b6fbd 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -201,9 +201,15 @@ class Coverage(object): if self._inited: return - # Create and configure the debugging controller. + # Create and configure the debugging controller. COVERAGE_DEBUG_FILE + # is an environment variable, the name of a file to append debug logs + # to. if self._debug_file is None: - self._debug_file = sys.stderr + debug_file_name = os.environ.get("COVERAGE_DEBUG_FILE") + if debug_file_name: + self._debug_file = open(debug_file_name, "a") + else: + self._debug_file = sys.stderr self.debug = DebugControl(self.config.debug, self._debug_file) # Load plugins |