mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix various logging statements
This commit is contained in:
@@ -27,12 +27,12 @@ def main(argv):
|
||||
help="Set the logging level", default='warning')
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.info('Loading GRT ini...')
|
||||
logging.info('Loading GRT configuration...')
|
||||
try:
|
||||
with open(args.config) as handle:
|
||||
config = yaml.load(handle)
|
||||
except Exception:
|
||||
logging.info('Using default GRT Configuration')
|
||||
logging.info('Using default GRT configuration')
|
||||
with open(sample_config) as handle:
|
||||
config = yaml.load(handle)
|
||||
|
||||
@@ -53,7 +53,7 @@ def main(argv):
|
||||
local_reports = [x.strip('.json') for x in os.listdir(REPORT_DIR) if x.endswith('.json')]
|
||||
for report_id in local_reports:
|
||||
if report_id not in remote_reports:
|
||||
print("Uploading %s" % report_id)
|
||||
logging.info("Uploading %s", report_id)
|
||||
files = {
|
||||
'meta': open(os.path.join(sys.argv[1], report_id + '.json'), 'rb'),
|
||||
'data': open(os.path.join(sys.argv[1], report_id + '.tsv.gz'), 'rb')
|
||||
@@ -62,7 +62,7 @@ def main(argv):
|
||||
'identifier': report_id
|
||||
}
|
||||
r = requests.post(GRT_URL + 'api/v2/upload', files=files, headers=headers, data=data)
|
||||
print(r.json())
|
||||
logging.info("Uploaded successfully", report_id)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
+2
-5
@@ -3,8 +3,6 @@
|
||||
|
||||
See doc/source/admin/grt.rst for more detailed usage information.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import tarfile
|
||||
import json
|
||||
@@ -15,7 +13,6 @@ import sys
|
||||
import time
|
||||
import yaml
|
||||
import logging
|
||||
# logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
@@ -191,12 +188,12 @@ def main(argv):
|
||||
logging.info(human_label)
|
||||
_times.append((label, time.time() - _start_time))
|
||||
|
||||
annotate('init_start', 'Loading GRT ini...')
|
||||
annotate('init_start', 'Loading GRT configuration...')
|
||||
try:
|
||||
with open(args.config) as handle:
|
||||
config = yaml.load(handle)
|
||||
except Exception:
|
||||
logging.info('Using default GRT Configuration')
|
||||
logging.info('Using default GRT configuration')
|
||||
with open(sample_config) as handle:
|
||||
config = yaml.load(handle)
|
||||
annotate('init_end')
|
||||
|
||||
Reference in New Issue
Block a user