mainsail-crew / mainsail

Mainsail is the popular web interface for managing and controlling 3D printers with Klipper.
https://docs.mainsail.xyz
GNU General Public License v3.0
1.68k stars 349 forks source link

feat(console): add debug prefix #1973

Closed nmaggioni closed 3 weeks ago

nmaggioni commented 1 month ago

Description

This PR implements a // debug: prefix for console messages that will have them displayed as greyed out. The implementation is based on the discussion had in #1950.

Related Tickets & Documents

Closes #1950.

Should this be mentioned in the docs? If so, where?

Mobile & Desktop Screenshots/Recordings

Examples generated with the following macro (RESPOND TYPE="command" MSG="debug: hello world" could have also been used):

[gcode_macro _LOG]
gcode:
  {action_respond_info("%s%s" % ("debug: " if params.DEBUG|default(0)|int == 1 else "", params.T))}

Before:

Old style output in the Console panel

After:

New style output in the Console panel

[optional] Are there any post-deployment tasks we need to perform?

N/A