Added logging and error macros.