def log_and_console(path_output_log, text_log, bool_log_new=False):
    """
    Write the log and show the text in console
    bool_log_new is used to erase the log file if it exists to avoid appending new data to the old one
    """
    if bool_log_new:
        print(text_log)
        with open(path_output_log, 'a') as fileLog:
            fileLog.write('')
        with open(path_output_log, 'w') as fileLog:
            fileLog.write(text_log)
            fileLog.write('\n')
    else:
        print(text_log)
        with open(path_output_log, 'a') as fileLog:
            fileLog.write(text_log)
            fileLog.write('\n')
