[Mod] Debug [debug]

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

[Mod] Debug [debug]

by lumberJack » Thu Oct 12, 2017 15:04

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 6 times
 

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

Re: [Mod] Debug [debug]

by ThomasMonroe » Thu Oct 12, 2017 16:10

sounds useful!
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

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

Re: [Mod] Debug [debug]

by lumberJack » Thu Oct 12, 2017 16:55

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: 278
Joined: Tue Apr 04, 2017 16:21
Location: Wherever I am at
GitHub: ThomasMonroe314
IRC: ThomasMonroe TMcSquared
In-game: ThomasMonroe TMcSquared

Re: [Mod] Debug [debug]

by ThomasMonroe » Fri Oct 13, 2017 13:03

exactly
Projects|:*sigh* school: :Qub³d: :Legends Of Survival: :making people think:
I don't make things messy, I just *cough* disturb the local entropy.
 

User avatar
DS-minetest
Member
 
Posts: 1026
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Debug [debug]

by DS-minetest » Mon Oct 16, 2017 18:14

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.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

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

Re: [Mod] Debug [debug]

by lumberJack » Fri Oct 27, 2017 17:55

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..
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests