fix logpath for real 2
This commit is contained in:
@@ -481,7 +481,7 @@ class TSbot:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Start logger
|
# Start logger
|
||||||
logpath = os.path.dirname(os.path.abspath(__file__)) + r"\log"
|
logpath = os.path.dirname(os.path.abspath(__file__)) + r"/log"
|
||||||
log = util.setupLogger(logpath)
|
log = util.setupLogger(logpath)
|
||||||
|
|
||||||
# Log unhandled exception
|
# Log unhandled exception
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ def setupLogger(logpath, lvl="DEBUG"):
|
|||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
if not os.path.exists(logpath):
|
if not os.path.exists(logpath):
|
||||||
os.makedirs(logpath)
|
os.makedirs(logpath)
|
||||||
handler = RotatingFileHandler(logpath + r"\myTS3.log", encoding='utf-8', maxBytes=5*1024*1024, backupCount=10)
|
handler = RotatingFileHandler(logpath + r"/myTS3.log", encoding='utf-8', maxBytes=5*1024*1024, backupCount=10)
|
||||||
logformat = logging.Formatter("%(asctime)s %(levelname)7s %(message)s", "%Y-%m-%d %H:%M:%S")
|
logformat = logging.Formatter("%(asctime)s %(levelname)7s %(message)s", "%Y-%m-%d %H:%M:%S")
|
||||||
handler.setFormatter(logformat)
|
handler.setFormatter(logformat)
|
||||||
log.addHandler(handler)
|
log.addHandler(handler)
|
||||||
|
|||||||
Reference in New Issue
Block a user