<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_pairs(self, format_string):
 """ Tokenize a logging format string and extract field names from tokens. :param format_string: The logging format string. :returns: A generator of :class:`FormatStringToken` objects. """

        for token in self.get_tokens(format_string):
            match = self.name_pattern.search(token)
            name = match.group(1) if match else None
            yield FormatStringToken(name=name, text=token)