<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(self, uuid=None, organization=None, from_date=None, to_date=None):
 """"List enrollment information available in the registry. Method that returns a list of enrollments. If <uuid> parameter is set, it will return the enrollments related to that unique identity; if <organization> parameter is given, it will return the enrollments related to that organization; if both parameters are set, the function will return the list of enrollments of <uuid> on the <organization>. Enrollments between a period can also be listed using <from_date> and <to_date> parameters. When these are set, the method will return all those enrollments where Enrollment.start >= from_date AND Enrollment.end <= to_date. Defaults values for these dates are 1900-01-01 and 2100-01-01. :param db: database manager :param uuid: unique identifier :param organization: name of the organization :param from_date: date when the enrollment starts :param to_date: date when the enrollment ends """

        try:
            enrollments = api.enrollments(self.db, uuid, organization,
                                          from_date, to_date)
            self.display('log.tmpl', enrollments=enrollments)
        except (NotFoundError, InvalidValueError) as e:
            self.error(str(e))
            return e.code

        return CMD_SUCCESS