Use loggging everywhere.
This commit is contained in:
parent
44ef61d544
commit
fa76abbb32
|
@ -59,6 +59,7 @@ class Main(object):
|
|||
except(ConfigurationError):
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
self.set_logging()
|
||||
#beurk
|
||||
swsync.utils.CONFIG = conf
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
# under the License.
|
||||
import time
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import swiftclient
|
||||
import dateutil.relativedelta
|
||||
|
@ -62,7 +63,7 @@ class Accounts(object):
|
|||
full_listing=True))
|
||||
|
||||
for container in orig_containers:
|
||||
print container
|
||||
logging.info("Syncronizing %s: %s", container['name'], container)
|
||||
dt1 = datetime.datetime.fromtimestamp(time.time())
|
||||
self.container_cls.sync(orig_storage_cnx,
|
||||
orig_storage_url,
|
||||
|
@ -74,10 +75,10 @@ class Accounts(object):
|
|||
dt2 = datetime.datetime.fromtimestamp(time.time())
|
||||
rd = dateutil.relativedelta.relativedelta(dt2, dt1)
|
||||
#TODO(chmou): use logging
|
||||
print "%d hours, %d minutes and %d seconds" % (rd.hours,
|
||||
rd.minutes,
|
||||
rd.seconds)
|
||||
print
|
||||
logging.info("%s done: %d hours, %d minutes and %d seconds",
|
||||
container['name'],
|
||||
rd.hours,
|
||||
rd.minutes, rd.seconds)
|
||||
|
||||
def process(self):
|
||||
"""Process all keystone accounts to sync."""
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import logging
|
||||
|
||||
import swiftclient
|
||||
import eventlet
|
||||
|
||||
|
@ -63,7 +65,7 @@ class Containers(object):
|
|||
pool = eventlet.GreenPool(size=self.max_gthreads)
|
||||
pile = eventlet.GreenPile(pool)
|
||||
for obj in diff:
|
||||
print obj
|
||||
logging.info("sending: %s ts:%s", obj[1], obj[0])
|
||||
pile.spawn(self.objects_cls,
|
||||
orig_storage_url,
|
||||
orig_token,
|
||||
|
|
Loading…
Reference in New Issue