changed all print statements for logging, and configured the default level using --debug argument as global