def convert_flags(flags, flag_dict, logger):
    """ Bitwise-OR of flags in conf and convert them to the readable flags """
    flaglist = []
    flagstr = ''
    logger.info('The given flags are %s ' % flags)
    if '|' not in flags:
        flagn = int(flags)
        flaglist.append(flagn)
    else:
        flaglist = flags.split('|')
        flagn = 0
        for flag in flaglist:
            flagn |= int(flag)
    for flag_key in flaglist:
        if int(flag_key) in flag_dict:
            flagstr += flag_dict.get(int(flag_key))
    logger.info('Converted flags:' + flagstr if flagstr != '' else 'no flag')
    return flaglist, flagn
