Log all prime numbers up to 1000.
Implement log_primes_up_to(n), where n is an inclusive upper bound. For testability, return the primes in ascending order instead of printing them; calling the function with n = 1000 satisfies the original task.
Input: An integer n.
Output: A list containing every prime number from 2 through n.
def log_primes_up_to(n):