'Rewrite logs for better processing.'

def _rewrite_logs(self, logs, symlogs):

    atoms = self.newf.atoms(log)
    logs = update_sets(logs, atoms, (lambda i: (i.args[0].is_rational_function(*self.T) and i.args[0].has(*self.T))))
    symlogs = update_sets(symlogs, atoms, (lambda i: (i.has(*self.T) and i.args[0].is_Pow and i.args[0].base.is_rational_function(*self.T) and (not i.args[0].exp.is_Integer))))
    for i in ordered(symlogs):
        lbase = log(i.args[0].base)
        logs.append(lbase)
        new = (i.args[0].exp * lbase)
        self.newf = self.newf.xreplace({i: new})
        self.backsubs.append((new, i))
    logs = sorted(set(logs), key=default_sort_key)
    return (logs, symlogs)
