Rename lines_max to max_lines which is the name used in other functions,
and inline the log_messages variable because its name was confusing.
The math.max(0, lines_max) call was not necessary because console
doesn't crash with 0 or negative max lines.