diff --git a/dnsupdate.py b/dnsupdate.py index ecb002d..d462c0f 100644 --- a/dnsupdate.py +++ b/dnsupdate.py @@ -31,7 +31,7 @@ def update_or_create_record_for_zone(driver, zone, name, type, ip): def run_config(config): cls = get_driver(Provider.AURORADNS) - print(config) + # logger.debug("Config {}".format(config)) ipv6 = requests.get('http://ip6only.me/api').text.split(',')[1] logger.info("IPv6: {}".format(ipv6)) @@ -68,10 +68,18 @@ if __name__ == '__main__': '-v', action='store_true' ) + argParser.add_argument( + '--silent', + '-s', + action='store_true', + help="Only log on warning (decreases verbosity). For use with cron." + ) args = argParser.parse_args() + + logLevel = logging.DEBUG if args.verbose else (logging.WARNING if args.silent else logging.INFO) - logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO) + logging.basicConfig(level=logLevel) with open(args.config, 'r') as fp: config = yaml.load(fp)