renamed add_msg to write for file likeness
use debug console from legger