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 | local conffilename = "script-opts/" .. identifier .. ".conf" | 40 | local conffilename = "script-opts/" .. identifier .. ".conf" |
| 41 | local conffile = mp.find_config_file(conffilename) | 41 | local conffile = mp.find_config_file(conffilename) |
| 42 | if conffile == nil then | 42 | if conffile == nil then |
| 43 | msg.verbose(conffilename .. " not found.") | 43 | msg.debug(conffilename .. " not found.") |
| 44 | conffilename = "lua-settings/" .. identifier .. ".conf" | 44 | conffilename = "lua-settings/" .. identifier .. ".conf" |
| 45 | conffile = mp.find_config_file(conffilename) | 45 | conffile = mp.find_config_file(conffilename) |
| 46 | if conffile then | 46 | if conffile then |
| @@ -50,9 +50,10 @@ local function read_options(options, identifier) · 3 unmodified lines | |||
| 50 | local f = conffile and io.open(conffile,"r") | 50 | local f = conffile and io.open(conffile,"r") |
| 51 | if f == nil then | 51 | if f == nil then |
| 52 | -- config not found | 52 | -- config not found |
| 53 | msg.verbose(conffilename .. " not found.") | 53 | msg.debug(conffilename .. " not found.") |
| 54 | else | 54 | else |
| 55 | -- config exists, read values | 55 | -- config exists, read values |
| 56 | msg.verbose("Opened config file " .. conffilename .. ".") | ||
| 56 | local linecounter = 1 | 57 | local linecounter = 1 |
| 57 | for line in f:lines() do | 58 | for line in f:lines() do |
| 58 | if string.find(line, "#") == 1 then | 59 | if string.find(line, "#") == 1 then |