It is currently very difficult to debug issues related to trigger functions. Adding logging locally could significally help with that. I've originally posted about it here.