History

lua: change config file logging

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.

wm4 committed 7 years ago

Commit fdce7781 parent 02cb44a1 file · +3 −2Browse files

Showing the changes to player/lua/options.lua (1 of 1 file). Show all

Unified · Split

player/lua/options.lua+3−2
@@ -40,7 +40,7 @@ local function read_options(options, identifier) · 39 unmodified lines
4040 local conffilename = "script-opts/" .. identifier .. ".conf"
4141 local conffile = mp.find_config_file(conffilename)
4242 if conffile == nil then
43− msg.verbose(conffilename .. " not found.")
43+ msg.debug(conffilename .. " not found.")
4444 conffilename = "lua-settings/" .. identifier .. ".conf"
4545 conffile = mp.find_config_file(conffilename)
4646 if conffile then
@@ -50,9 +50,10 @@ local function read_options(options, identifier) · 3 unmodified lines
5050 local f = conffile and io.open(conffile,"r")
5151 if f == nil then
5252 -- config not found
53− msg.verbose(conffilename .. " not found.")
53+ msg.debug(conffilename .. " not found.")
5454 else
5555 -- config exists, read values
56+ msg.verbose("Opened config file " .. conffilename .. ".")
5657 local linecounter = 1
5758 for line in f:lines() do
5859 if string.find(line, "#") == 1 then

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t