3198: Added Collection.rename (needs test). Fixing tests broken on account of
[arvados.git] / sdk / python / arvados / __init__.py
index 42c4b3aae63b4c460fa4fc19bea3180c41fb5d9f..19a7ad84390dcf0b0b35aa6c3ff3e6b9f7a48790 100644 (file)
@@ -22,9 +22,21 @@ from api import *
 from collection import *
 from keep import *
 from stream import *
+from arvfile import *
 import errors
 import util
 
+# Set up Arvados logging based on the user's configuration.
+# All Arvados code should log under the arvados hierarchy.
+log_handler = logging.StreamHandler()
+log_handler.setFormatter(logging.Formatter(
+        '%(asctime)s %(name)s[%(process)d] %(levelname)s: %(message)s',
+        '%Y-%m-%d %H:%M:%S'))
+logger = logging.getLogger('arvados')
+logger.addHandler(log_handler)
+logger.setLevel(logging.DEBUG if config.get('ARVADOS_DEBUG')
+                else logging.WARNING)
+
 def task_set_output(self,s):
     api('v1').job_tasks().update(uuid=self['uuid'],
                                  body={
@@ -76,6 +88,7 @@ class job_setup:
             return
         job_input = current_job()['script_parameters']['input']
         cr = CollectionReader(job_input)
+        cr.normalize()
         for s in cr.all_streams():
             for f in s.all_files():
                 if input_as_path:
@@ -119,5 +132,3 @@ class job_setup:
                                        body={'success':True}
                                        ).execute()
             exit(0)
-
-