Might be worth hooking into write warning and error too?