Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
https://doc.qt.io/qt-5/qtglobal.html#qSetMessagePattern has a %{function} placeholder which is really useful. However, if you have several related functions whose output should be viewed together (e.g. as a set of steps, with indenting indicating e.g. loops), it becomes difficult to follow:
29:14:428 GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:428 GameController::maybeAddDeployAction: - nothing being deployed; skipping Deploy action 29:14:428 GameController::maybeAddUseAbilityOnTargetAction: - the player doesn't have any active ability; skipping UseAbilityOnTarget action 29:14:428 GameController::maybeAddExitLevelAction: - Tiled tile at cursor pos is out of bounds or is marked as an exitLevel tile; adding ExitLevel action 29:14:867 GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:867 GameController::updateHoveredActions: - either there's no current level or no selected entity; no actions 29:14:868 GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:868 GameController::updateHoveredActions: - either there's no current level or no selected entity; no actions
It would be nice if there was a way to pad the function name:
%{function padding=30 paddingchar="."}
or to treat it as a "column" and set its width:
%{function columnwidth=30 paddingchar="."}
Then the output would become much easier to read:
29:14:428 ............GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:428 ............GameController::maybeAddDeployAction: - nothing being deployed; skipping Deploy action 29:14:428 GameController::maybeAddUseAbilityOnTargetAction: - the player doesn't have any active ability; skipping UseAbilityOnTarget action 29:14:428 .........GameController::maybeAddExitLevelAction: - Tiled tile at cursor pos is out of bounds or is marked as an exitLevel tile; adding ExitLevel action 29:14:867 ............GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:867 ............GameController::updateHoveredActions: - either there's no current level or no selected entity; no actions 29:14:868 ............GameController::updateHoveredActions: updating hovered actions for cursor tile pos: QPoint(12,-4) 29:14:868 ............GameController::updateHoveredActions: - either there's no current level or no selected entity; no actions
I imagine these would also be useful for the other placeholders.