diff --git a/lua/tjdevries/log.lua b/lua/tjdevries/log.lua index a51d077..a4dd9f8 100644 --- a/lua/tjdevries/log.lua +++ b/lua/tjdevries/log.lua @@ -2,6 +2,7 @@ -- -- Inspired by rxi/log.lua -- Modified by tjdevries and can be found at github.com/tjdevries/vlog.nvim +-- Further modified by sherlock5512 as part of these dotfiles -- -- This library is free software; you can redistribute it and/or modify it -- under the terms of the MIT license. See LICENSE for details. @@ -109,6 +110,7 @@ log.new = function(config, standalone) vim.cmd(string.format("echohl %s", level_config.hl)) end +---@diagnostic disable-next-line: missing-parameter -- This function can be called with only two parameters local split_console = vim.split(console_string, "\n") for _, v in ipairs(split_console) do vim.cmd(string.format([[echom "[%s] %s"]], config.plugin, vim.fn.escape(v, '"'))) @@ -121,7 +123,7 @@ log.new = function(config, standalone) -- Output to log file if config.use_file then - local fp = io.open(outfile, "a") + local fp = assert(io.open(outfile, "a"),"Could not open " .. outfile .. "!") local str = string.format("[%-6s%s] %s: %s\n", nameupper, os.date(), lineinfo, msg) fp:write(str)