Skip to content

Commit 0f94205

Browse files
Fixed debug messages appearing when neither debug nor trace are set.
Needed to compaer log levels with >= instead of <.
1 parent 95c2aba commit 0f94205

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/devcontainer-cli/log.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ log.new = function(config, standalone)
9696
local lineinfo = info.short_src .. ":" .. info.currentline
9797

9898
-- Output to console
99-
if config.use_console and level < levels[config.console_level] then
99+
if config.use_console and level >= levels[config.console_level] then
100100
local console_string = string.format(
101101
"[%-6s%s] %s: %s",
102102
nameupper,
@@ -120,7 +120,7 @@ log.new = function(config, standalone)
120120
end
121121

122122
-- Output to log file
123-
if config.use_file and level < levels[config.log_level] then
123+
if config.use_file and level >= levels[config.log_level] then
124124
local fp = io.open(outfile, "a")
125125
local str = string.format("[%-6s%s] %s: %s\n",
126126
nameupper, os.date(), lineinfo, msg)

0 commit comments

Comments
 (0)