pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Console command output is emitted to the logger #2543

Closed dktapps closed 2 years ago

dktapps commented 5 years ago

Issue description

This is a problem which also exists on the vanilla PC server. When the console writes a command, the output is recorded to the log instead of being emitted directly to the console. This is annoying for multiple reasons:

Ideally, the CLI and the log output should be emitted to two independent windows, a bit like RCON. However, this is challenging to implement in a manner which is cross-platform.

For what it's worth, the MCPE vanilla server doesn't emit command output to the log.

Steps to reproduce the issue

  1. Write a command in the console like help.
  2. Notice that the output lands in your log file for no good reason.

Problems with changing this

PocketMine-MP has historically attempted to mimic PC vanilla, particularly with respect to command output. This is because some PC server tools like Multicrap rely on the specifics of the logger output. However, I don't believe we should allow this problem to stand in the way of improving PocketMine-MP.

Frago9876543210 commented 5 years ago

What about continuous logging? For example, when you enter a command and several players write to the chat at the same time, the command moves several lines.

dktapps commented 5 years ago

That nut is difficult to crack. This also comes from the problem that CLI and logger are on the same page when they shouldn't be.

dktapps commented 5 years ago

I tried to implement this and ran into a few issues:

It would seem logical that an extension to this would be to separate the command-output part of CommandSender from the rest of it.