Skip to content

Commit

Permalink
cleanup config before saving to log
Browse files Browse the repository at this point in the history
  • Loading branch information
nlef committed Jun 13, 2022
1 parent f98eabe commit 4b7b417
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,9 +1406,13 @@ def parselog():
configWrap = ConfigWrapper(conf)
configWrap.bot.log_path_update(system_args.logfile)

conf_copy = configparser.ConfigParser(allow_no_value=True, inline_comment_prefixes=(";", "#"))
conf_copy.read(system_args.configfile)
conf_copy.set("bot", "bot_token", "")
conf_copy.set("bot", "chat_id", "")
with open(configWrap.bot.log_file, "a", encoding="utf-8") as f:
f.write("\nCurrent Monraker telegram bot config\n")
conf.write(f)
conf_copy.write(f)
f.write("\n")

rotatingHandler = RotatingFileHandler(
Expand Down

0 comments on commit 4b7b417

Please sign in to comment.