added function y_msg_f which can output formatted messages