Example #1
0
#     # formatStr = '[%(asctime)s] - %(name)s - {%(pathname)s:%(lineno)d} ' + \
#     #            '%(levelname)s - %(message)s', datefmt
#     logging.basicConfig(format=formatStr,
#                         datefmt=datefmt,
#                         level=logging.DEBUG)

    logger = logging.getLogger(__name__)
    logger.info("fiurst log message!")
    # define what environment to work with
    env = 'PRD'

    # used to help with formatting information into a string that
    # can be included in an email.
    emailReporter = Reporting.EmailStrings()
    dataCache = Reporting.CachedStrings()
    dataUtil = DataUtil.GetData(env)

    # add a header to the email
    jenkinsUrl = dataUtil.getMiscParam(Constants.JENKINSURL)
    ln1 = "    ----  DataBC Replication Health Check  ----\n"
    ln2 = 'src: https://github.com/bcgov/replication_health_check\n'
    ln3 = f'jenkins: {jenkinsUrl}\n\n\n'
    emailHeaderString = ln1 + ln2 + ln3
    dataCache.setString(emailHeaderString)
    logger.debug(f"emailHeaderString: {emailHeaderString}")

    # get the disabled schedules string
    scheds = dataUtil.getFMESchedules()
    schedsEval = ScheduleEvaluation.EvaluateSchedule(scheds)

    disabledSchedules = schedsEval.getDisabled()