Fix noneffective static variable cache in log_message()