added  error handling macro dbg.h
Added calling function name in error logs of dbg.h