diff options
author | Baudouin Raoult <baudouin.raoult@ecmwf.int> | 2018-05-23 14:46:29 +0200 |
---|---|---|
committer | Baudouin Raoult <baudouin.raoult@ecmwf.int> | 2018-05-23 14:46:29 +0200 |
commit | f75c2e0ba96c98f5293de7a9b349a512669a6268 (patch) | |
tree | 7ce7860835460caeb26579519b9410e0ab018f82 | |
parent | 9b8667ad2b09eef2881ed872068a51e2518ceb37 (diff) |
amout
-rw-r--r-- | cdsapi/api.py | 11 | ||||
-rwxr-xr-x | example-era5.py | 5 | ||||
-rwxr-xr-x | example-glaciers.py | 5 |
3 files changed, 11 insertions, 10 deletions
diff --git a/cdsapi/api.py b/cdsapi/api.py index cacc84b..adc1b6d 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -44,6 +44,7 @@ class Client(object): url=os.environ.get('CDSAPI_URL'), key=os.environ.get('CDSAPI_KEY'), quiet=False, + debug=False, verify=None, timeout=None, full_stack=False, @@ -56,6 +57,16 @@ class Client(object): debug_callback=None, ): + if not quiet: + + if debug: + level = logging.DEBUG + else: + level = logging.INFO + + logging.basicConfig(level=level, + format='%(asctime)s %(levelname)s %(message)s') + dotrc = os.environ.get('CDSAPI_RC', os.path.expanduser('~/.cdsapirc')) if url is None or key is None: diff --git a/example-era5.py b/example-era5.py index 859e2b0..bafd5a0 100755 --- a/example-era5.py +++ b/example-era5.py @@ -9,11 +9,6 @@ # does it submit to any jurisdiction. import cdsapi -import logging - - -logging.basicConfig(level=logging.INFO, - format='%(asctime)s %(levelname)s %(message)s') c = cdsapi.Client() diff --git a/example-glaciers.py b/example-glaciers.py index 8915e4b..f14fa67 100755 --- a/example-glaciers.py +++ b/example-glaciers.py @@ -9,11 +9,6 @@ # does it submit to any jurisdiction. import cdsapi -import logging - - -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(levelname)s %(message)s') c = cdsapi.Client() |