Skip to content

Commit

Permalink
fixing config variable to be config_file, setting default debug to be…
Browse files Browse the repository at this point in the history
… false
  • Loading branch information
Shawn Sterling committed Oct 14, 2014
1 parent b75e860 commit c4afd3b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions graphios.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
# is passed as a command line argument we will use that instead.
config_file = ''

# change me to False before releasing
debug = True
# This is overridden via config file
debug = False

# config dictionary
cfg = {}
Expand Down Expand Up @@ -241,12 +241,13 @@ def configure():
log.addHandler(log_handler)

if "debug" in cfg and cfg["debug"] is True:
print("adding streamhandler")
log.debug("adding streamhandler")
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler())
debug = True
else:
log.setLevel(logging.INFO)
debug = False


def process_log(file_name):
Expand Down Expand Up @@ -447,17 +448,17 @@ def main():


if __name__ == '__main__':
global cfg
if len(sys.argv) > 1:
(options, args) = parser.parse_args()
if options.config:
cfg = read_config(options.config)
# print options
if options.config_file:
cfg = read_config(options.config_file)
else:
cfg = verify_options(options)
else:
cfg = read_config(config_file)
verify_config(cfg)
configure()
print cfg # fix me, comment me out before release
# print cfg
init_backends()
main()

0 comments on commit c4afd3b

Please sign in to comment.