Skip to content

Commit

Permalink
Basic logging improvement
Browse files Browse the repository at this point in the history
The process_ids of the launched shards will now be written to file,
allowing them to be easily found by a later teardown script, or just
manually.
  • Loading branch information
matthew-robertson committed Jan 15, 2019
1 parent 6c62ca6 commit a5dab88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
for x in range(0, shard_count):
processes.append(subprocess.Popen(['python', 'bot.py', str(x), str(shard_count)]))
print("Launched processes")
print(processes.pid)
with open("logs/pids.txt", "w") as target:
for process in processes:
target.write('{}\n'.format(process.pid))
else:
print("Can't reach the Gateway endpoint. Giving up.")

0 comments on commit a5dab88

Please sign in to comment.