diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/msger.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/scripts/lib/wic/msger.py b/scripts/lib/wic/msger.py index fb8336d94a..dc9b73427d 100644 --- a/scripts/lib/wic/msger.py +++ b/scripts/lib/wic/msger.py | |||
@@ -207,29 +207,3 @@ def set_logfile(fpath): | |||
207 | 207 | ||
208 | import atexit | 208 | import atexit |
209 | atexit.register(_savelogf) | 209 | atexit.register(_savelogf) |
210 | |||
211 | def enable_logstderr(fpath): | ||
212 | global CATCHERR_BUFFILE_FD | ||
213 | global CATCHERR_BUFFILE_PATH | ||
214 | global CATCHERR_SAVED_2 | ||
215 | |||
216 | if os.path.exists(fpath): | ||
217 | os.remove(fpath) | ||
218 | CATCHERR_BUFFILE_PATH = fpath | ||
219 | CATCHERR_BUFFILE_FD = os.open(CATCHERR_BUFFILE_PATH, os.O_RDWR|os.O_CREAT) | ||
220 | CATCHERR_SAVED_2 = os.dup(2) | ||
221 | os.dup2(CATCHERR_BUFFILE_FD, 2) | ||
222 | |||
223 | def disable_logstderr(): | ||
224 | global CATCHERR_BUFFILE_FD | ||
225 | global CATCHERR_BUFFILE_PATH | ||
226 | global CATCHERR_SAVED_2 | ||
227 | |||
228 | raw(msg=None) # flush message buffer and print it. | ||
229 | os.dup2(CATCHERR_SAVED_2, 2) | ||
230 | os.close(CATCHERR_SAVED_2) | ||
231 | os.close(CATCHERR_BUFFILE_FD) | ||
232 | os.unlink(CATCHERR_BUFFILE_PATH) | ||
233 | CATCHERR_BUFFILE_FD = -1 | ||
234 | CATCHERR_BUFFILE_PATH = None | ||
235 | CATCHERR_SAVED_2 = -1 | ||