Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: tools/android/loading/cloud/backend/worker.py

Issue 2039723003: tools/android/loading Add timestamps to backend logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert to UTC Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/android/loading/cloud/frontend/clovis_frontend.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import argparse 5 import argparse
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 import time
10 11
11 from googleapiclient import discovery 12 from googleapiclient import discovery
12 from oauth2client.client import GoogleCredentials 13 from oauth2client.client import GoogleCredentials
13 14
14 # NOTE: The parent directory needs to be first in sys.path to avoid conflicts 15 # NOTE: The parent directory needs to be first in sys.path to avoid conflicts
15 # with catapult modules that have colliding names, as catapult inserts itself 16 # with catapult modules that have colliding names, as catapult inserts itself
16 # into the path as the second element. This is an ugly and fragile hack. 17 # into the path as the second element. This is an ugly and fragile hack.
17 _CLOUD_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 18 _CLOUD_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
18 os.pardir) 19 os.pardir)
19 sys.path.insert(0, os.path.join(_CLOUD_DIR, os.pardir)) 20 sys.path.insert(0, os.path.join(_CLOUD_DIR, os.pardir))
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 # any time. 199 # any time.
199 200
200 if __name__ == '__main__': 201 if __name__ == '__main__':
201 parser = argparse.ArgumentParser( 202 parser = argparse.ArgumentParser(
202 description='ComputeEngine Worker for Clovis') 203 description='ComputeEngine Worker for Clovis')
203 parser.add_argument('--config', required=True, 204 parser.add_argument('--config', required=True,
204 help='Path to the configuration file.') 205 help='Path to the configuration file.')
205 args = parser.parse_args() 206 args = parser.parse_args()
206 207
207 # Configure logging. 208 # Configure logging.
208 logging.basicConfig(level=logging.WARNING) 209 logging.basicConfig(level=logging.WARNING,
210 format='[%(asctime)s][%(levelname)s] %(message)s',
211 datefmt='%y-%m-%d %H:%M:%S')
212 logging.Formatter.converter = time.gmtime
209 worker_logger = logging.getLogger('worker') 213 worker_logger = logging.getLogger('worker')
210 worker_logger.setLevel(logging.INFO) 214 worker_logger.setLevel(logging.INFO)
211 215
212 worker_logger.info('Reading configuration') 216 worker_logger.info('Reading configuration')
213 with open(args.config) as config_json: 217 with open(args.config) as config_json:
214 worker = Worker(json.load(config_json), worker_logger) 218 worker = Worker(json.load(config_json), worker_logger)
215 worker.Start() 219 worker.Start()
OLDNEW
« no previous file with comments | « no previous file | tools/android/loading/cloud/frontend/clovis_frontend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698