Merge branch '3457-pysdk-logging-wip'
[arvados.git] / sdk / python / arvados / api.py
index 8a71b90c0dda661ea0ac8bfbcd17e47cb1ee36b9..7c60f51bd9a12e095c56b0c45e2d20690adf0b80 100644 (file)
@@ -12,6 +12,7 @@ import config
 import errors
 import util
 
+_logger = logging.getLogger('arvados.api')
 services = {}
 
 class CredentialsFromEnv(object):
@@ -82,14 +83,11 @@ def api(version=None, cache=True, **kwargs):
     `apiclient.discovery.build`.  If the `discoveryServiceUrl` or `http`
     keyword arguments are missing, this function will set default values for
     them, based on the current Arvados configuration settings."""
-    if config.get('ARVADOS_DEBUG'):
-        logging.basicConfig(level=logging.DEBUG)
-
     if not cache or not services.get(version):
         if not version:
             version = 'v1'
-            logging.info("Using default API version. " +
-                         "Call arvados.api('%s') instead." %
+            _logger.info("Using default API version. " +
+                         "Call arvados.api('%s') instead.",
                          version)
 
         if 'discoveryServiceUrl' not in kwargs: