From fdce778605648da249bef9eb0c9ce31ada89777e Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 Nov 2019 01:52:05 +0100 Subject: 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. --- player/lua/options.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player/lua') diff --git a/player/lua/options.lua b/player/lua/options.lua index 4d05587ef1..a23417ae7d 100644 --- a/player/lua/options.lua +++ b/player/lua/options.lua @@ -40,7 +40,7 @@ local function read_options(options, identifier) local conffilename = "script-opts/" .. identifier .. ".conf" local conffile = mp.find_config_file(conffilename) if conffile == nil then - msg.verbose(conffilename .. " not found.") + msg.debug(conffilename .. " not found.") conffilename = "lua-settings/" .. identifier .. ".conf" conffile = mp.find_config_file(conffilename) if conffile then @@ -50,9 +50,10 @@ local function read_options(options, identifier) local f = conffile and io.open(conffile,"r") if f == nil then -- config not found - msg.verbose(conffilename .. " not found.") + msg.debug(conffilename .. " not found.") else -- config exists, read values + msg.verbose("Opened config file " .. conffilename .. ".") local linecounter = 1 for line in f:lines() do if string.find(line, "#") == 1 then -- cgit v1.2.3