]> git.e2factory.org Git - e2factory.git/commitdiff
cleanup: debug log was broken due to modularization. Fix.
authorGordon Hecker <gh@emlix.com>
Fri, 5 Feb 2010 16:31:13 +0000 (17:31 +0100)
committerGordon Hecker <gh@emlix.com>
Fri, 12 Feb 2010 09:52:00 +0000 (10:52 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
generic/e2lib.lua
local/e2tool.lua

index 8ebd8129502859bb43ef698e9c31583fa4cad89c..0108e548ad2a8f8bb4bbffc9d5d0b4ca374284b2 100644 (file)
@@ -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")
index da6ff965d5a794f02b33e5f5b36fd584869da908..b8106e2bd3354a484fa6d178f386bb7cb3dcd3cc 100644 (file)
@@ -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