[core/config] enable logging into a log file

Re-enable the -f | --logfile parameter, but still default to logging to
stderr.

Also, add a "debug" module that is automatically displayed if a bar is
run in debug mode (thanks to @bbernhard for the excellent suggestion)

fixes #614
This commit is contained in:
tobi-wan-kenobi 2020-05-01 09:41:06 +02:00
parent 650942a3e3
commit 595778f7c3
3 changed files with 45 additions and 6 deletions

View file

@ -26,6 +26,7 @@ class Config(util.store.Store):
help='Specify a list of modules to hide when not in warning/error state')
parser.add_argument('-d', '--debug', action='store_true',
help='Add debug fields to i3 output')
parser.add_argument('-f', '--logfile', help='destination for the debug log file, if -d|--debug is specified; defaults to stderr')
self.__args = parser.parse_args(args)
parameters = [ item for sub in self.__args.parameters for item in sub ]
@ -45,6 +46,9 @@ class Config(util.store.Store):
def debug(self):
return self.__args.debug
def logfile(self):
return self.__args.logfile
def theme(self):
return self.__args.theme