Skip to content

Commit

Permalink
Replace the -l flag with -o for specifying the output file
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Oct 15, 2013
1 parent 396f173 commit f2c5e54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/vmpoller-client
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def main():

usage="""
Usage:
vmpoller-client [-r <retries>] [-t <timeout>] [-l <logfile>] (-D|-H) -c discover -V <vcenter> -e <endpoint>
vmpoller-client [-r <retries>] [-t <timeout>] [-l <logfile>] -H -n <name> -p <property> -c poll -V <vcenter> -e <endpoint>
vmpoller-client [-r <retries>] [-t <timeout>] [-l <logfile>] -D -u <datastore-url> -p <property> -c poll -V <vcenter> -e <endpoint>
vmpoller-client [-r <retries>] [-t <timeout>] [-o <logfile>] (-D|-H) -c discover -V <vcenter> -e <endpoint>
vmpoller-client [-r <retries>] [-t <timeout>] [-o <logfile>] -H -n <name> -p <property> -c poll -V <vcenter> -e <endpoint>
vmpoller-client [-r <retries>] [-t <timeout>] [-o <logfile>] -D -u <datastore-url> -p <property> -c poll -V <vcenter> -e <endpoint>
vmpoller-client --help
vmpoller-client --version
Expand All @@ -60,19 +60,19 @@ Options:
-t <timeout>, --timeout <timeout> Timeout after that period of milliseconds [default: 3000]
-e <endpoint>, --endpoint <endpoint> Endpoint of ZeroMQ Proxy/Broker the client connects to
[default: tcp://localhost:10123]
-l <logfile>, --logfile <logfile> Specify the log file to use when performing the poll
-o <logfile>, --output <logfile> Specify the log file to use when performing the poll
[default: /var/log/vmpoller/vmpoller-client.log]
"""

args = docopt(usage, version="1.0.0")

if args["--logfile"] == "-":
if args["--output"] == "-":
logging.basicConfig(stream=sys.stdout,
format='%(asctime)s - %(levelname)s - vmpoller-client[%(process)s]: %(message)s',
level=logging.DEBUG)
else:
logging.basicConfig(filename=args["--logfile"],
logging.basicConfig(filename=args["--output"],
format='%(asctime)s - %(levelname)s - vmpoller-client[%(process)s]: %(message)s',
level=logging.DEBUG)

Expand Down
8 changes: 4 additions & 4 deletions src/vmpoller-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def status(endpoint):
def main():

usage="""
Usage: vmpoller-proxy [-d] [-p <pidfile>] [-f <config-file>] [-l <logfile>] start
Usage: vmpoller-proxy [-d] [-p <pidfile>] [-f <config-file>] [-o <logfile>] start
vmpoller-proxy -e <endpoint> stop
vmpoller-proxy -e <endpoint> status
vmpoller-proxy --help
Expand All @@ -113,19 +113,19 @@ Options:
-f <config-file>, --config <config-file> Specify config file to use
[default: /etc/vmpoller/vmpoller-proxy.conf]
-e <endpoint>, --endpoint <endpoint> Specify the endpoint we connect to
-l <logfile>, --logfile <logfile> Specify the logfile to use
-o <logfile>, --output <logfile> Specify the logfile to use
[default: /var/log/vmpoller/vmpoller-proxy.log]
"""

args = docopt(usage, version="1.0.0")

if args["--logfile"] == "-":
if args["--output"] == "-":
logging.basicConfig(stream=stdout,
format='%(asctime)s - %(levelname)s - vmpoller-proxy[%(process)s]: %(message)s',
level=logging.DEBUG)
else:
logging.basicConfig(filename=args["--logfile"],
logging.basicConfig(filename=args["--output"],
format='%(asctime)s - %(levelname)s - vmpoller-proxy[%(process)s]: %(message)s',
level=logging.DEBUG)

Expand Down
8 changes: 4 additions & 4 deletions src/vmpoller-worker
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def status(endpoint):

def main():
usage="""
Usage: vmpoller-worker [-d] [-p <pidfile>] [-f <config-file>] [-l <logfile>] start
Usage: vmpoller-worker [-d] [-p <pidfile>] [-f <config-file>] [-o <logfile>] start
vmpoller-worker -e <endpoint> stop
vmpoller-worker -e <endpoint> status
vmpoller-worker --help
Expand All @@ -115,19 +115,19 @@ Options:
-f <config-file>, --config <config-file> Specify config file to use
[default: /etc/vmpoller/vmpoller-worker.conf]
-e <endpoint>, --endpoint <endpoint> Specify the endpoint we connect to
-l <logfile>, --logfile <logfile> Specify the logfile to use
-o <logfile>, --output <logfile> Specify the logfile to use
[default: /var/log/vmpoller/vmpoller-worker.log]
"""

args = docopt(usage, version="1.0.0")

if args["--logfile"] == "-":
if args["--output"] == "-":
logging.basicConfig(stream=sys.stdout,
format='%(asctime)s - %(levelname)s - vmpoller-worker[%(process)s]: %(message)s',
level=logging.DEBUG)
else:
logging.basicConfig(filename=args["--logfile"],
logging.basicConfig(filename=args["--output"],
format='%(asctime)s - %(levelname)s - vmpoller-worker[%(process)s]: %(message)s',
level=logging.DEBUG)

Expand Down

0 comments on commit f2c5e54

Please sign in to comment.