Pocketmine-mp: Add more debug levels

Created on 27 Feb 2017  路  7Comments  路  Source: pmmp/PocketMine-MP

Issue description

Currently there are only debug levels 1 (no debug) and 2 (all debug spam).

Proposed changes

Debug levels:

  • 1: No debug
  • 2: Plugin debugging
  • 3: Core
  • 4: Network?
Core Stale To Do

Most helpful comment

@madecode15
$sever->getLogger()->debug($message, $level); default level: current level

All 7 comments

How will you add this without an ugly API?

Example: $sever->getLogger()->debugNetwork("ugly API");

The API shouldn't change. It will just display different things depending on what is set in the config, Right?

@madecode15
$sever->getLogger()->debug($message, $level); default level: current level

It seems like it would be a better idea to split up the global logger into multiple sub loggers which can each have their own debug level. Since work is already underway to de-globalise logging, this might be possible to introduce along the way.

What for? The idea is not bad :(

The idea is terrible, and makes no sense. Subsystem-specific logging configurations offer more flexibility, but that isn't the topic of this issue.

The main reason is about not conforming to PSR-3.

It actually makes sense to have multiple levels of log displaying, but that's something we have already done with log levels, and multiple debug levels simply reinvented the log level hierarchy with less sound definitions.

Was this page helpful?
0 / 5 - 0 ratings