<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_parsing_plan(self, desired_type: Type[T], filesystem_object: PersistedObject, logger: Logger, _main_call: bool = True):
 """ Implements the abstract parent method by using the recursive parsing plan impl. Subclasses wishing to produce their own parsing plans should rather override _create_parsing_plan in order to benefit from this same log msg. :param desired_type: :param filesystem_object: :param logger: :param _main_call: internal parameter for recursive calls. Should not be changed by the user. :return: """

        in_root_call = False

        # -- log msg only for the root call, not for the children that will be created by the code below
        if _main_call and (not hasattr(AnyParser.thrd_locals, 'flag_init') or AnyParser.thrd_locals.flag_init == 0):
            # print('Building a parsing plan to parse ' + str(filesystem_object) + ' into a ' +
            #      get_pretty_type_str(desired_type))
            logger.debug('Building a parsing plan to parse [{location}] into a {type}'
                         ''.format(location=filesystem_object.get_pretty_location(append_file_ext=False),
                                   type=get_pretty_type_str(desired_type)))
            AnyParser.thrd_locals.flag_init = 1
            in_root_call = True

        # -- create the parsing plan
        try:
            pp = self._create_parsing_plan(desired_type, filesystem_object, logger, log_only_last=(not _main_call))
        finally:
            # remove threadlocal flag if needed
            if in_root_call:
                AnyParser.thrd_locals.flag_init = 0

        # -- log success only if in root call
        if in_root_call:
            # print('Parsing Plan created successfully')
            logger.debug('Parsing Plan created successfully')

        # -- finally return
        return pp