Implemented logger, added --debug option, prints full error stack trace if debug level