Commit 1a2ca9b8 authored by Daniele Venzano's avatar Daniele Venzano

Add time to logs

parent 902a9b7f
......@@ -34,6 +34,7 @@ from zoe_master.workspace.filesystem import ZoeFSWorkspace
from zoe_master.workspace.hdfs import ZoeHDFSWorkspace
log = logging.getLogger("main")
LOG_FORMAT = '%(asctime)-15s %(levelname)s %(name)s (%(threadName)s): %(message)s'
def main():
......@@ -44,10 +45,10 @@ def main():
config.load_configuration()
args = config.get_conf()
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
else:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logging.getLogger('kazoo').setLevel(logging.WARNING)
logging.getLogger('requests').setLevel(logging.WARNING)
......
......@@ -26,6 +26,7 @@ from zoe_observer.guest_inactivity import check_guests
from zoe_lib.exceptions import ZoeAPIException
log = logging.getLogger("main")
LOG_FORMAT = '%(asctime)-15s %(levelname)s %(name)s (%(threadName)s): %(message)s'
def guest_check_thread(args):
......@@ -68,10 +69,9 @@ def main():
load_configuration()
args = get_conf()
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
else:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logging.getLogger('kazoo').setLevel(logging.WARNING)
logging.getLogger('requests').setLevel(logging.WARNING)
......
......@@ -23,6 +23,7 @@ from zoe_web import app
from zoe_web.config import load_configuration, get_conf
log = logging.getLogger("zoe_web")
LOG_FORMAT = '%(asctime)-15s %(levelname)s %(name)s (%(threadName)s): %(message)s'
def zoe_web_main() -> int:
......@@ -33,9 +34,9 @@ def zoe_web_main() -> int:
load_configuration()
args = get_conf()
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
else:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("tornado").setLevel(logging.DEBUG)
......
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