small cleanups
This commit is contained in:
parent
530fd2a2ba
commit
15cac995ec
1 changed files with 5 additions and 6 deletions
11
linspector
11
linspector
|
|
@ -8,11 +8,10 @@ import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
import os
|
import os
|
||||||
import os.path as path
|
import os.path as path
|
||||||
|
|
||||||
from lib.frontends.lish import LishFrontend
|
|
||||||
from lib.config.parser import FullConfigParser
|
|
||||||
from apscheduler.scheduler import Scheduler
|
from apscheduler.scheduler import Scheduler
|
||||||
|
from lib.config.parser import FullConfigParser
|
||||||
from lib.core.job import Job
|
from lib.core.job import Job
|
||||||
|
from lib.frontends.lish import LishFrontend
|
||||||
|
|
||||||
|
|
||||||
def parseArgs():
|
def parseArgs():
|
||||||
|
|
@ -41,7 +40,7 @@ def parseArgs():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def setup_logging(logfile="./log/linspector.log", logLevel=logging.DEBUG, logfileLevel=logging.DEBUG):
|
def setupLogging(logfile="./log/linspector.log", logLevel=logging.DEBUG, logfileLevel=logging.DEBUG):
|
||||||
logfile = path.expanduser(logfile)
|
logfile = path.expanduser(logfile)
|
||||||
if not path.exists(path.dirname(logfile)):
|
if not path.exists(path.dirname(logfile)):
|
||||||
os.makedirs(path.dirname(logfile))
|
os.makedirs(path.dirname(logfile))
|
||||||
|
|
@ -73,8 +72,8 @@ def handleJob(jobInfo):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parseArgs()
|
args = parseArgs()
|
||||||
print args.logfile
|
|
||||||
log = setup_logging(args.logfile, args.loglevel)
|
log = setupLogging(args.logfile, args.loglevel)
|
||||||
|
|
||||||
log.info("parsed arguments")
|
log.info("parsed arguments")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue