Skip to content

Commit

Permalink
Add the option to override the logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
brd committed Oct 14, 2021
1 parent 3b3521e commit 32cd229
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions passiveagent/lite.py → lite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

import config
import argparse
import logging
import requests
import signal
Expand Down Expand Up @@ -30,8 +30,14 @@ def handle_exit(signum, frame):
sys.exit(0)

def main():
parser = argparse.ArgumentParser(description="Passive Agent")
parser.add_argument('-l', '--logfile', default='/var/log/lite.log',
help='override the location of the logfile')
args = parser.parse_args()
print(f'args: {args.log}')
sys.exit(3)
# Setup logging
logging.basicConfig(filename='lite.log', level=logging.INFO,
logging.basicConfig(filename=args.logfile, level=logging.INFO,
format='%(asctime)s %(message)s', datefmt='%Y/%m/%d %I:%M:%S')
logging.info('Starting up..')
initialize_signal_handlers()
Expand Down

0 comments on commit 32cd229

Please sign in to comment.