Skip to content

Commit

Permalink
chore: add debug logging (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil authored Jul 23, 2024
1 parent 956ba1b commit c8d35a4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lua/neotest-golang/logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ local prefix = "[neotest-golang] "

local function clean_output(str)
-- Replace escaped newlines and tabs with spaces
str = str:gsub("\\n", " "):gsub("\\t", " ")
-- Remove any remaining actual newlines and tabs
str = str:gsub("[\n\t]", " ")
-- Collapse multiple spaces into one
str = str:gsub("%s+", " ")
Expand Down
2 changes: 1 addition & 1 deletion lua/neotest-golang/process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function M.test_results(spec, result, tree)
end

-- DEBUG: enable the following to see the final Neotest result.
-- logger.debug(vim.inspect(neotest_results))
-- logger.debug(vim.inspect(neotest_result))

return neotest_result
end
Expand Down
1 change: 1 addition & 0 deletions lua/neotest-golang/runspec/dir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function M.build(pos)
context = context,
}

logger.debug({ "RunSpec:", run_spec })
return run_spec
end

Expand Down
1 change: 1 addition & 0 deletions lua/neotest-golang/runspec/file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function M.build(pos, tree)
context = context,
}

logger.debug({ "RunSpec:", run_spec })
return run_spec
end

Expand Down
1 change: 1 addition & 0 deletions lua/neotest-golang/runspec/namespace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function M.build(pos)
context = context,
}

logger.debug({ "RunSpec:", run_spec })
return run_spec
end

Expand Down
1 change: 1 addition & 0 deletions lua/neotest-golang/runspec/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function M.build(pos, strategy)
run_spec.context.parse_test_results = false
end

logger.debug({ "RunSpec:", run_spec })
return run_spec
end

Expand Down

0 comments on commit c8d35a4

Please sign in to comment.