From 79c0c7d1c74be23dbcbb63ca4b14ee4bddfa683f Mon Sep 17 00:00:00 2001 From: Ievgenii Shepeliuk Date: Tue, 14 Nov 2023 20:00:51 +0200 Subject: [PATCH] fix: broken log file path for NullLsLog Signed-off-by: Ievgenii Shepeliuk --- lua/null-ls/logger.lua | 2 +- test/spec/logger_spec.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/spec/logger_spec.lua diff --git a/lua/null-ls/logger.lua b/lua/null-ls/logger.lua index 43f076a0..bce0b692 100644 --- a/lua/null-ls/logger.lua +++ b/lua/null-ls/logger.lua @@ -51,7 +51,7 @@ end ---Retrieves the path of the logfile ---@return string path of the logfile function log:get_path() - return u.path.join(vim.fn.stdpath("cache"), "null-ls.log") + return u.path.join(vim.fn.stdpath("cache"), "null-ls") end ---Add a log entry at TRACE level diff --git a/test/spec/logger_spec.lua b/test/spec/logger_spec.lua new file mode 100644 index 00000000..c43dd8aa --- /dev/null +++ b/test/spec/logger_spec.lua @@ -0,0 +1,8 @@ +local logger = require("null-ls.logger") + +describe("logger", function() + it("get_path should return log file path from cache folder", function() + local expected = vim.fn.stdpath("cache") .. "/" .. "null-ls" + assert.equals(expected, logger.get_path()) + end) +end)