[Mod] Debugging Console [console]

Post Reply
User avatar
sorcerykid
Member
Posts: 1451
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

[Mod] Debugging Console [console]

by sorcerykid » Post

Debugging Console Mod v1.0
console (by sorcerykid)

The Debugging Console mod greatly simplifies outputting of debug information to privileged users directly in-game, without the need for the ever so cumbersome minetest.chat_send_player().

Now it is as simple as calling printf(), which supports substitution of values a-la string.format() as well as lists of values if provided a table for its first argument. Helpful chat commands include /pipe for piping the input of any API function to the debug console for realtime inspection and /tail for continuously following the output stream of any plain-text log file on the server, such as debug.txt.

Image

The console can also be toggled into a more compact form or hidden entirely by pressing SHIFT+E at any time.

Image

And with the /debug chat command, it's possible to copy the entire debug output into another application for more detailed review.

Image

Repository:

https://bitbucket.org/sorcerykid/console

Download Archive (.zip)
Download Archive (.tar.gz)

Dependencies:

Configuration Panel

Source Code License:

The MIT License (MIT)

rheo
Member
Posts: 37
Joined: Fri May 03, 2019 20:40
GitHub: fluxionary
IRC: flux fluxflux
In-game: flux rheo

Re: [Mod] Debugging Console [console]

by rheo » Post

This looks really useful.

Why not override

Code: Select all

minetest.log()
w/ a hook that also prints to your mod's console? It seems troublesome to force everyone to make use of your

Code: Select all

printf
when another logging standard already exists. Though I suppose that's trivial to add ad-hoc for any server owner who knows the mod API.

Also curious that you're using

Code: Select all

depends.txt
instead of

Code: Select all

mod.conf
.

User avatar
sorcerykid
Member
Posts: 1451
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Debugging Console [console]

by sorcerykid » Post

Thanks for the feedback.

This isn't a tool for logging, it's a tool for all-purpose debugging. It provides an alternative to "print()" and "minetest.chat_send_all()" for outputting program state on the fly. I have no plans to override any core API functions with different behavior, since everyone has different needs and requirements. I personally, wouldn't want debugging info filling my log files. But it's easy enough to adapt for that purpose if needed.

Post Reply

Who is online

Users browsing this forum: Google [Bot], LibraSubtilis and 8 guests