Commit 79938907 authored by Barry Warsaw's avatar Barry Warsaw

Since we have a helper function _set_log_dest(), let's go ahead and

use that everywhere internally instead of setting the global _log_dest
directly.
parent af6684f5
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.12 $'[11:-2] __version__='$Revision: 1.13 $'[11:-2]
import os, sys, time import os, sys, time
...@@ -48,7 +48,7 @@ class stupid_log_write: ...@@ -48,7 +48,7 @@ class stupid_log_write:
self.initialize() self.initialize()
def initialize(self): def initialize(self):
global _log_dest, _log_level global _log_level
eget = os.environ.get eget = os.environ.get
# EVENT_LOG_FILE is the preferred envvar, but we accept # EVENT_LOG_FILE is the preferred envvar, but we accept
...@@ -57,12 +57,12 @@ class stupid_log_write: ...@@ -57,12 +57,12 @@ class stupid_log_write:
if path is None: if path is None:
path = eget('STUPID_LOG_FILE') path = eget('STUPID_LOG_FILE')
if path is None: if path is None:
_log_dest = None _set_log_dest(None)
else: else:
if path: if path:
_log_dest = open(path, 'a') _set_log_dest(open(path, 'a'))
else: else:
_log_dest = sys.stderr _set_log_dest(sys.stderr)
# EVENT_LOG_SEVERITY is the preferred envvar, but we accept # EVENT_LOG_SEVERITY is the preferred envvar, but we accept
# STUPID_LOG_SEVERITY also # STUPID_LOG_SEVERITY also
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment