home ~ socials ~ projects ~ rss

Write To A Log File From A Neovim Lua Plugin

June 2021

This is the function I'm using while working on Neovim plugins.

local log_to_file = function(message, path)
    local log_file_path = path 
    local log_file = io.open(log_file_path, "a")
    io.output(log_file)
    io.write(message.."\n")
    io.close(log_file)
end
end of line
Share link:
https://www.alanwsmith.com/en/20/eo/7j/xp/?write-to-a-log-file-from-a-neovim-lua-plugin