From: Gordon Hecker Date: Fri, 5 Feb 2010 16:31:13 +0000 (+0100) Subject: cleanup: debug log was broken due to modularization. Fix. X-Git-Tag: e2factory-2.3.4pre1~15 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=c4e366618480d2578bd64fc9a43f494ec9f80a01;p=e2factory.git cleanup: debug log was broken due to modularization. Fix. Signed-off-by: Gordon Hecker --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 8ebd812..0108e54 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -370,9 +370,11 @@ function log(level, msg) msg = msg:sub(1, msg:len() - 1) end -- always write log level to debug logfile - globals.debuglogfile:write(log_prefix .. msg) - globals.debuglogfile:write("\n") - globals.debuglogfile:flush() + if globals.debuglogfile then + globals.debuglogfile:write(log_prefix .. msg) + globals.debuglogfile:write("\n") + globals.debuglogfile:flush() + end if getlog(level) then if globals.log_debug then io.stderr:write(log_prefix) @@ -1875,5 +1877,3 @@ function align(columns, align1, string1, align2, string2) end return s end - -globals.debuglogfile = io.open("/dev/null", "w") diff --git a/local/e2tool.lua b/local/e2tool.lua index da6ff96..b8106e2 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -277,7 +277,7 @@ function opendebuglogfile(info) local e = new_error("error opening debug logfile") return false, e:cat(re) end - e2lib.debuglogfile = debuglogfile + e2lib.globals.debuglogfile = debuglogfile return true, nil end