Improve logging, make difference between err and dbg