def format_invoked_opts(opts,commline_list=[]):
    """
        Prints the invoked options to stdout and the logfile.

        :param object opts: An object storing the relevant options
        :param list commline_list: The entered command line arguments
        :return fopts_list: A formatted list of options
        :rtype: list
    """    
    fopts_list = []
    if len(commline_list) != 0:
        fopts_list.append("Invoked command line: ")
        fopts_list.append(" ".join(commline_list))
        fopts_list.append("")
        
    fopts_list.append("Invoked options: ")    
    for key, value in opts.__dict__.items():
        fopts_list.append("   " + key + ": " + str(value))
    fopts_list.append("")
    return fopts_list