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

Side by Side Diff: testing/legion/common_lib.py

Issue 890773003: Adding the initial code for Omnibot multi-machine support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 """Common library methods.
5
6 These methods can be used by both the host and the client code.
7 """
8 import argparse
9 import logging
10 import socket
11 import sys
12 import xmlrpclib
13 import SimpleXMLRPCServer
14
15 LOGGING_FORMAT = ('%(asctime)s %(filename)s:%(lineno)s %(levelname)s] '
16 '%(message)s')
17 LOGGING_DATE_FORMAT = '%H:%M:%S'
18 MY_IP = socket.gethostbyname(socket.gethostname())
19
20
21 def InitLogging():
22 """Initialize the logging module."""
23 parser = argparse.ArgumentParser()
24 parser.add_argument('--verbose', action='store_true')
25 args, _ = parser.parse_known_args()
26 level = logging.DEBUG if args.verbose else logging.INFO
27 logging.basicConfig(format=LOGGING_FORMAT, datefmt=LOGGING_DATE_FORMAT,
28 level=level)
29
30
31 def LogCommandLine():
32 """Log the command line used to run this program."""
33 logging.debug(' '.join(sys.argv))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698