-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of random print() calls #127
Get rid of random print() calls #127
Conversation
I think the prints in the Lua tube should stay, makes more sense than logging IMO. The others are fine to be removed. (one of them was me forgetting to remove it :P) |
Done in ba00a49 |
Shouldn't really, while print is easy on What it ultimately should do is exactly same what mesecons does (besides mod name): local function safe_print(param)
if mesecon.setting("luacontroller_print_behavior", "log") == "log" then
local string_meta = getmetatable("")
local sandbox = string_meta.__index
string_meta.__index = string -- Leave string sandbox temporarily
minetest.log("action", string.format("[mesecons_luacontroller] print(%s)", dump(param)))
string_meta.__index = sandbox -- Restore string sandbox
end
end |
Done in 739ddc6 (BTW, perhaps it would be better if you can utilize GitHub's review function to give suggestions) |
I would probably have used suggestion as I usually do but you can't add suggestions without changes and previous commit did revert changes so there were not enough changed lines for suggestion feature. |
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, did not test it but seems it should work just fine.
In game lua tube print function now also works same as mesecons.
Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
Oh, this wasn't merged yet. |
This PR gets rid of
print()
calls by either removing them or changing them into appropriateminetest.log
calls. This PR is ready for review.