Using logging module instead of print and verbose flag.