From 5563886c07f9dee88c96a2ac734c36c050d50cca Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Wed, 13 Jul 2016 12:56:19 -0400 Subject: [PATCH] basic logging for ridad. --- ridad.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ridad.py b/ridad.py index ba25355f..49818441 100755 --- a/ridad.py +++ b/ridad.py @@ -1,7 +1,5 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- - - # Copyright (c) 2016 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -31,11 +29,15 @@ This is the main component of the orchestrator and is responsible for proper scheduling component builds in the supported build systems. """ +import logging import os import threading + import rida.config import rida.messaging +log = logging.getLogger() + # TODO: Load the config file from environment config = rida.config.from_file("rida.conf") @@ -74,11 +76,15 @@ class Polling(threading.Thread): # TODO: Sleep for a configuration-determined interval pass -try: - messaging_thread = Messaging() - polling_thread = Polling() - messaging_thread.start() - polling_thread.start() -except KeyboardInterrupt: - # FIXME: Make this less brutal - os._exit() + +if __name__ == '__main__': + logging.basicConfig(level=logging.DEBUG) # For now + logging.info("Starting ridad.") + try: + messaging_thread = Messaging() + polling_thread = Polling() + messaging_thread.start() + polling_thread.start() + except KeyboardInterrupt: + # FIXME: Make this less brutal + os._exit()