Created
August 8, 2020 03:56
-
-
Save subsoap/b019739dbb095d7bb263539fe2622568 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- save reference to original function | |
local local_print = print | |
-- replace with our custom function | |
print = function(...) | |
-- print stacktrace | |
local_print(debug.traceback()) | |
-- call original function | |
local_print(...) | |
end | |
print("test") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will monkey patch a Lua script so that you can find where the prints are. Useful if you have commented may prints out too. You can easily make a pprint() variant as well.