def main(): LoggingUtils.setup_logs() email = '' password = '' optimalq_connector = OptimalQConnector(email, password) token = optimalq_connector.get_token() consumer_group = 'get_recommendations' pool_uid = '' snooze_seconds = 10 recommendations_amount_topic = 'recommendations_topic' recommendations_topic = 'push_recommendations_topic' get_recommendations = GetRecommendations(token, optimalq_connector, pool_uid, snooze_seconds, consumer_group, recommendations_amount_topic, recommendations_topic) try: get_recommendations.start() except SystemExit: logging.info("GetRecommendationsGenesys instructed to stop.") except Exception as ex: logging.exception( "Exception in GetRecommendationsGenesys! - {}".format(ex)) if get_recommendations is not None: get_recommendations.terminate() logging.info("GetRecommendationsGenesys has terminated.")
def main(): LoggingUtils.setup_logs() call_report = CallReportGenesys() try: call_report.start() except SystemExit: logging.info("CallReportGenesys instructed to stop.") except Exception as ex: logging.exception("Exception in CallReportGenesys! - {}".format(ex)) if call_report is not None: call_report.terminate() logging.info("CallReportGenesys has terminated.")
def test_logging(): my_logger = LoggingUtils.setup_logger() my_logger.debug("debug") my_logger.info("info") my_logger.warning('warning') my_logger.error('error') my_logger.critical('critical')
def main(): logging = LoggingUtils.setup_logger() logging.info(__name__ + ': Starting application.') batch_runner = BatchRunner(ETLImpl()) batch_runner.consistency_check() batch_runner.processBatch() batch_runner.update_status() logging.info(__name__ + ': Done.')
def main(): LoggingUtils.setup_logs() group = "push_recommendations" recommendations_topic = 'push_recommendations_topic' push_recommendations = PushRecommendationsGenesys(group, recommendations_topic) try: push_recommendations.start() except SystemExit: logging.info("PushRecommendationsGenesys instructed to stop.") except Exception as ex: logging.exception( "Exception in PushRecommendationsGenesys! - {}".format(ex)) if push_recommendations is not None: push_recommendations.terminate() logging.info("PushRecommendationsGenesys has terminated.")
def main(): LoggingUtils.setup_logs() email = '' password = '' optimalq_connector = OptimalQConnector(email, password) token = optimalq_connector.get_token() group = "sync_report" pool_uid = "" call_reports_topic = 'call_report_topic' sync_report = SyncReport(group, token, optimalq_connector, pool_uid, call_reports_topic) try: sync_report.start() except SystemExit: logging.info("SyncReport instructed to stop.") except Exception as ex: logging.exception("Exception in SyncReport! - {}".format(ex)) if sync_report is not None: sync_report.terminate() logging.info("SyncReport has terminated.")
from flask import request, session, flash from MySQLdb import escape_string as thwart from passlib.hash import sha256_crypt from db.db import connection from utils.db_utils import DbUtils from utils.session_utils import SessionUtils from utils.logging_utils import LoggingUtils import logging LoggingUtils.initialize_logger(__name__) class Login: @classmethod def do_login(cls): logger = logging.getLogger(__name__) success = False c, conn = connection() # fetch and validate username username = str(request.form['username']) success = cls._is_username_valid(c, username) # fetch and validate password if success: password = str(request.form['password']) success = cls._is_password_valid(c, username, password) # fetch and validate album info # TODO - fetch album_name && album_id
''' Created on Sep 20, 2017 @author: arturnowicki ''' from time import sleep from utils.logging_utils import LoggingUtils logger1 = LoggingUtils().get_logger() logger2 = LoggingUtils().get_logger() logger1.warning("a;sldkfjsalfkj") sleep(200) print("aaa")