Added logger for errors and debug