add io:format logger and fix logging condition