mcpyproject / McPy

A open source Minecraft server written 100% in Python
GNU Affero General Public License v3.0
84 stars 15 forks source link

Inconsisent log formatting #57

Closed Geolykt closed 3 years ago

Geolykt commented 3 years ago

Describe the bug the startup.py file uses a different logging format than the rest of the project

To Reproduce Steps to reproduce the behavior:

  1. Run python3 startup.py

Expected behavior Uniform logging format

Host system:

Additional context Current output is:

INFO:root:Making sure pip is installed...
Defaulting to user installation because normal site-packages is not writeable
Looking in links: /tmp/tmp4e2vgybv
Requirement already up-to-date: setuptools in /usr/lib/python3.9/site-packages (49.1.3)
Requirement already up-to-date: pip in /usr/lib/python3.9/site-packages (20.2.2)
INFO:root:Installed.
INFO:root:Getting release list...
INFO:root:McPy found! Running it...
root | INFO | Trying to initialize the Blackfire probe
root | INFO | Blackfire not installed: passing
root | INFO | Starting queues...
root | INFO | Started queues!
root | INFO | Trying to find number of available cores
root | INFO | Found 2 cores available!
root | INFO | Starting worker ID 84619
root | INFO | Started worker.
root | INFO | Worker ID 84619 has started up.
root | INFO | Starting networking worker
root | INFO | Started worker.
root | INFO | Startup done! Listening on 0.0.0.0:25565
^Croot | INFO | Shutting server down!
root | INFO | Worker ID 84619 has completed all tasks.
Traceback (most recent call last):
  File "/home/Geolykt/git/McPy/startup.py", line 174, in <module>
    mcpyProcess = subprocess.check_call(data)
  File "/usr/lib64/python3.9/subprocess.py", line 368, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.9/subprocess.py", line 351, in call
    return p.wait(timeout=timeout)
  File "/usr/lib64/python3.9/subprocess.py", line 1185, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib64/python3.9/subprocess.py", line 1915, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib64/python3.9/subprocess.py", line 1873, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
ntoskrnl4 commented 3 years ago

well, I guess this is solved by startup.py no longer existing, lol

Geolykt commented 3 years ago

It suffers the same issues. I also have discovered that the formatting is different across plattforms (maybe, idk - but it appears so). Should I fix that or nah? under my System it is root | INFO | <message> while it appears that it should actually be [<time> - INFO - MainThread] <message>

ntoskrnl4 commented 3 years ago

You could fix it if you want, but it's not really significant in any meaningful capacity.

Geolykt commented 3 years ago

Did it anyway as it was needed to make the user change their logging format (stupid feature, but has no maintenance so why not?)