Using logging module instead of printing and verbose flag.