add: log messages woth python module 'logging' instead of print

This commit is contained in:
Bernhard Stampfer
2016-05-07 20:51:06 +02:00
parent d124755c88
commit 54ce22c0c1
6 changed files with 36 additions and 28 deletions

12
run.py
View File

@@ -4,8 +4,18 @@ from app import app
from os import urandom
from app import gui
import thread
import logging
if __name__ == '__main__':
#logging!
logfile = "baroness.log"
#logging.basicConfig(filename=logfile, level=logging.WARNING)
logging.basicConfig(level=logging.DEBUG)
logging.info("Baroness started!")
print "Baroness started: logging to ", logfile
#start gui
wx = wx.App()
gui.MainWindow(None)
@@ -13,6 +23,6 @@ if __name__ == '__main__':
# start flask
app.secret_key = urandom(24)
app.run(debug=True)
app.run(host="0.0.0.0")
#app.run()