<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def max_id_length(self):
 """ Returns the maximum length of a todo ID, used for formatting purposes. """

        if config().identifiers() == "text":
            return max_id_length(len(self._todos))
        else:
            try:
                return math.ceil(math.log(len(self._todos), 10))
            except ValueError:
                return 0