Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 # any time. | 198 # any time. |
| 199 | 199 |
| 200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
| 201 parser = argparse.ArgumentParser( | 201 parser = argparse.ArgumentParser( |
| 202 description='ComputeEngine Worker for Clovis') | 202 description='ComputeEngine Worker for Clovis') |
| 203 parser.add_argument('--config', required=True, | 203 parser.add_argument('--config', required=True, |
| 204 help='Path to the configuration file.') | 204 help='Path to the configuration file.') |
| 205 args = parser.parse_args() | 205 args = parser.parse_args() |
| 206 | 206 |
| 207 # Configure logging. | 207 # Configure logging. |
| 208 logging.basicConfig(level=logging.WARNING) | 208 logging.basicConfig(level=logging.WARNING, |
| 209 format='[%(asctime)s][%(levelname)s] %(message)s', | |
|
mattcary
2016/06/06 14:50:23
Do you know if this ends up matching the same time
droger
2016/06/06 15:25:24
It seems it is the same, but this is probably by c
| |
| 210 datefmt='%y-%m-%d %H:%M:%S') | |
| 209 worker_logger = logging.getLogger('worker') | 211 worker_logger = logging.getLogger('worker') |
| 210 worker_logger.setLevel(logging.INFO) | 212 worker_logger.setLevel(logging.INFO) |
| 211 | 213 |
| 212 worker_logger.info('Reading configuration') | 214 worker_logger.info('Reading configuration') |
| 213 with open(args.config) as config_json: | 215 with open(args.config) as config_json: |
| 214 worker = Worker(json.load(config_json), worker_logger) | 216 worker = Worker(json.load(config_json), worker_logger) |
| 215 worker.Start() | 217 worker.Start() |
| OLD | NEW |