Use case: I'm cleaning up the data*lua files of BI, moving out compatibility code for other mods to external files. There are a lot of files with similar names (e.g. "updates/mod_name.lua" and "final-fixes/mod_name.lua"), and I've moved files between folders several times. In order to check that I didn't forget to require a file, I want to output the file path and name whenever a file is entered. Using fixed strings for that is not an option because I may forget to change the message text after moving or renaming a file.
I know that something like this would work:
Code: Select all
if not BI.check_mods("alien-biomes") then
log("Nothing to do!")
return
end
Code: Select all
if not BI.check_mods("alien-biomes") then
log_wrapper(get_current_file_name() .. ": Nothing to do!")
return
end