Split debug and error logging