Make the existing "not found" messages debug only, and add a new verbose message if a config file was opened. The idea is that logging should make it apparent whether or not config files are loaded, and it's more common to use scripts without config files, leading to fewer log messages in verbose mode.
Showing the changes to player/lua/options.lua (1 of 1 file). Show all
Unified · Split
| @@ -40,7 +40,7 @@ local function read_options(options, identifier) · 39 unmodified lines | ||
| 40 | 40 | local conffilename = "script-opts/" .. identifier .. ".conf" |
| 41 | 41 | local conffile = mp.find_config_file(conffilename) |
| 42 | 42 | if conffile == nil then |
| 43 | − msg.verbose(conffilename .. " not found.") | |
| 43 | + msg.debug(conffilename .. " not found.") | |
| 44 | 44 | conffilename = "lua-settings/" .. identifier .. ".conf" |
| 45 | 45 | conffile = mp.find_config_file(conffilename) |
| 46 | 46 | if conffile then |
| @@ -50,9 +50,10 @@ local function read_options(options, identifier) · 3 unmodified lines | ||
| 50 | 50 | local f = conffile and io.open(conffile,"r") |
| 51 | 51 | if f == nil then |
| 52 | 52 | -- config not found |
| 53 | − msg.verbose(conffilename .. " not found.") | |
| 53 | + msg.debug(conffilename .. " not found.") | |
| 54 | 54 | else |
| 55 | 55 | -- config exists, read values |
| 56 | + msg.verbose("Opened config file " .. conffilename .. ".") | |
| 56 | 57 | local linecounter = 1 |
| 57 | 58 | for line in f:lines() do |
| 58 | 59 | if string.find(line, "#") == 1 then |