david_walker committed b8762c4

put log file in temp directory instead of current dir

  • Participants
  • Parent commits ff3c3da

Comments (0)

Files changed (1)

 import StringIO
 import codecs
 import logging
+import os
+import sys
 import tempfile
-import sys
 from clipboard import get_clipboard_text, set_clipboard_text
 from base import Token
     errors in Kiva loan descriptions.
-    # Initialize logging to go to a file
-    handler = logging.FileHandler("kea.log", "w", encoding="UTF-8")
+    # Initialize logging to go to a temporary file
+    temp_file_name = os.path.join(tempfile.gettempdir(), "kea.log")
+    handler = logging.FileHandler(temp_file_name, "w", encoding="UTF-8")
     formatter = logging.Formatter("%(message)s")
     root_logger = logging.getLogger()