Fixed issue with logging unicode characters in some cp1252 systems

This commit is contained in:
Manuel Cortez 2019-06-12 22:43:57 -05:00
parent 6a16a66b5e
commit 4e5941cdf4

View File

@ -12,7 +12,7 @@ import sys
storage.setup() storage.setup()
# Let's import config module here as it is dependent on storage being setup. # Let's import config module here as it is dependent on storage being setup.
import config import config
logging.basicConfig(filename=os.path.join(storage.data_directory, "info.log"), level=logging.DEBUG, filemode="w") logging.basicConfig(handlers=[logging.FileHandler(os.path.join(storage.data_directory, "info.log"), "w", "utf-8")], level=logging.DEBUG)
# Let's mute the google discovery_cache logger as we won't use it and we'll avoid some tracebacks. # Let's mute the google discovery_cache logger as we won't use it and we'll avoid some tracebacks.
glog = logging.getLogger("googleapiclient.discovery_cache") glog = logging.getLogger("googleapiclient.discovery_cache")
glog.setLevel(logging.CRITICAL) glog.setLevel(logging.CRITICAL)