From ba6fbfa68f730aaabc4df79a578819d07e5667ed Mon Sep 17 00:00:00 2001 From: ExeVirus Date: Wed, 18 Jan 2023 21:07:51 -0500 Subject: [PATCH] Fix minetest.log levels: Most are now verbose --- init.lua | 2 +- markdown2formspec/formspec_writer.lua | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index c457f9d..5c904cb 100644 --- a/init.lua +++ b/init.lua @@ -45,7 +45,7 @@ end -- settings: color and sizing config table of settings md2f.md2f = function(x,y,w,h,text,name,settings) if text == nil then - minetest.log("markdown2formspec: No text provided") + minetest.log("warning","markdown2formspec: No text provided") return "" end name = name or "markdown" diff --git a/markdown2formspec/formspec_writer.lua b/markdown2formspec/formspec_writer.lua index efc077b..32b28d0 100644 --- a/markdown2formspec/formspec_writer.lua +++ b/markdown2formspec/formspec_writer.lua @@ -28,19 +28,19 @@ function M.new(options) Hyper.citation = escape Hyper.verbatim = function(s) local _, count = string.gsub(s, "\n", "") - minetest.log("TABSIZE = " .. md2f.settings.tab_size .. ":: NBSP: " .. nbsp) + minetest.log("verbose", "TABSIZE = " .. md2f.settings.tab_size .. ":: NBSP: " .. nbsp) local tab = string.rep(nbsp, md2f.settings.tab_size) return table.concat({""}) end function Hyper.code(s) - minetest.log("code") + minetest.log("verbose","code") return {""} end function Hyper.fenced_code(s) - minetest.log("fenced_code") + minetest.log("verbose","fenced_code") return Hyper.verbatim(s) end @@ -49,17 +49,17 @@ function M.new(options) end function Hyper.emphasis(s) - minetest.log("emphasis") + minetest.log("verbose","emphasis") return {"",s,""} end function Hyper.strong(s) - minetest.log("strong") + minetest.log("verbose","strong") return {"",s,""} end function Hyper.strong_emphasis(s) - minetest.log("strong emphasis") + minetest.log("verbose","strong emphasis") return {"",s,""} end @@ -71,7 +71,7 @@ function M.new(options) end function Hyper.blockquote(s) - minetest.log("blockquote") + minetest.log("verbose","blockquote") --tab over local tab = string.rep(nbsp, md2f.settings.tab_size) table.insert(s[1],1,tab) @@ -89,7 +89,7 @@ function M.new(options) end function Hyper.bulletlist(items,tight) - minetest.log("bulletlist") + minetest.log("verbose","bulletlist") for i,str in ipairs(items) do table.insert(str, 1, table.concat({nbsp,"•",nbsp})) end @@ -98,7 +98,7 @@ function M.new(options) end function Hyper.orderedlist(items,tight) - minetest.log("orderedlist") + minetest.log("verbose","orderedlist") for i,str in ipairs(items) do table.insert(str, 1, table.concat({i,".",nbsp})) end @@ -106,12 +106,12 @@ function M.new(options) end function Hyper.link(label, uri, title) - minetest.log("link") + minetest.log("verbose","link") return {"",label,"", " () "} end function Hyper.image(label, src, title) - minetest.log("image") + minetest.log("verbose","image") --parse the minetest data from the filename: local _,_,w,h,float = label[1]:find("(%d*),?(%d*),?([lr]*)") local _,_,filename = src:find("([%w%p]*)")