Use static variables for log levels, use log.WARN instead of integer.
Modified test script to use getopt