[Mod] Debug [debug]

Post Reply
lumberJack
Member
Posts: 29
Joined: Wed Apr 06, 2016 23:38
GitHub: kakalak-lumberJack
IRC: lumberJack lumberJuice
In-game: lumberJack
Location: North Carolina, US

[Mod] Debug [debug]

by lumberJack » Post

A Minetest mod that allows in-game debugging/monitoring of the minetest logfile (default: /home/minetest/.minetest/debug.txt).

Github: https://github.com/kakalak-lumberJack/debug


Features

Adds in-game commands to read/search logfiles for players with ban priv. Returns to the player's chat:
  • Return the last 100 entries from the logfile.

    Code: Select all

    /debug


    Return the last 100 entries from logfile containing the search term

    Code: Select all

    /grep <searchterm>
    In-game command to shutdown the server with 10 second delay.

    Code: Select all

    "/shutdown"
Automates keeping logfile at a managable size by archiving (tar format) the logfire in the same folder and creating a new debug.txt on shutdown when the file reaches about 30MB.

Requirements
  • This mod was developed/tested on Debian 8. may need some tweaking to work on other operating systems.

    Requires Lua Filesystem. You can inntall via Luarocks https://luarocks.org/modules/hisham/luafilesystem:

    Code: Select all

    luarocks install luafilesystem


    Requires tar on operating system Mod must be listed in minetest.conf under trusted mods:

    Code: Select all

    secure.trusted mods = debug
    The init.lua file must be configured to the path of your log file. See comments in the file for more info.

    No other mod dependencies.
License
  • MIT --See license.txt
Attachments
debug-master.zip
(2.87 KiB) Downloaded 84 times

User avatar
ThomasMonroe
Member
Posts: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [Mod] Debug [debug]

by ThomasMonroe » Post

sounds useful!
I don't make messes, I just, er...disturb the local entropy!

lumberJack
Member
Posts: 29
Joined: Wed Apr 06, 2016 23:38
GitHub: kakalak-lumberJack
IRC: lumberJack lumberJuice
In-game: lumberJack
Location: North Carolina, US

Re: [Mod] Debug [debug]

by lumberJack » Post

ThomasMonroe wrote:sounds useful!
Thanks, Thomas. Yes I think so, especially if you run a server on VPS or have admins/moderators w/o server access.

User avatar
ThomasMonroe
Member
Posts: 286
Joined: Tue Apr 04, 2017 16:21
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared
Location: Wherever I am at

Re: [Mod] Debug [debug]

by ThomasMonroe » Post

exactly
I don't make messes, I just, er...disturb the local entropy!

User avatar
Desour
Member
Posts: 1473
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Debug [debug]

by Desour » Post

Nice idea! Useful for moderators and players who want to help the owner with his problem.
Instead of ban priv use for the debug and the grep command maybe the debug priv. (I'm not sure if you already have that priv in your mt version, use the minetest ppa ppa:minetestdevs/stable or ppa:minetestdevs/daily-builds.)
Why not use the param of the debug chatcommand for the count of the lines to chat out instead of hardcoding it to 100? And maybe also add a second param for the start of the lines instead of 0 (hint: minetest has a string.split function).
Could you please chat the lines all at once instead of using minetest.chat_send_player once per line? And add a prefix like "debug:debug_output lines:0-100". That would be very useful for a csm that prints out the debug stuff instead of letting it into the chat.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

lumberJack
Member
Posts: 29
Joined: Wed Apr 06, 2016 23:38
GitHub: kakalak-lumberJack
IRC: lumberJack lumberJuice
In-game: lumberJack
Location: North Carolina, US

Re: [Mod] Debug [debug]

by lumberJack » Post

DS-minetest wrote:Nice idea! Useful for moderators and players who want to help the owner with his problem.
Instead of ban priv use for the debug and the grep command maybe the debug priv. (I'm not sure if you already have that priv in your mt version, use the minetest ppa ppa:minetestdevs/stable or ppa:minetestdevs/daily-builds.)
Why not use the param of the debug chatcommand for the count of the lines to chat out instead of hardcoding it to 100? And maybe also add a second param for the start of the lines instead of 0 (hint: minetest has a string.split function).
Could you please chat the lines all at once instead of using minetest.chat_send_player once per line? And add a prefix like "debug:debug_output lines:0-100". That would be very useful for a csm that prints out the debug stuff instead of letting it into the chat.
Some good suggestions. I just wrote this as a quick test of concept for a friend but if there is interest I'll continue to develop it with more nuance. Thanks for the feedback..

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests