debug function uses mkws.log rather than old mkws.debug.