Fix noneffective static variable cache in log_message()

A nicer solution would be to simply change the reference assignment to a normal one.