]> git.e2factory.org Git - e2factory.git/commitdiff
cleanup: remove code that logs tool invocations
authorGordon Hecker <gh@emlix.com>
Fri, 12 Feb 2010 14:40:15 +0000 (15:40 +0100)
committerGordon Hecker <gh@emlix.com>
Wed, 17 Feb 2010 11:04:20 +0000 (12:04 +0100)
Signed-off-by: Gordon Hecker <gh@emlix.com>
13 files changed:
Changelog
generic/e2lib.lua
global/e2-create-project.lua.in
global/e2-fetch-project.lua.in
global/e2-install-e2.lua.in
local/build-numbers.lua
local/build.lua
local/dlist.lua
local/dsort.lua
local/fetch-sources.lua
local/ls-project.lua
local/new-source.lua
local/playground.lua

index a600a33e0c47fb22e0a23c9c548d33102d9666ca..1918ee39b56c0bc9ae81f93a3c8a5ce886d64e99 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -21,6 +21,7 @@ NEXT:
  * code related to external tools was moved into the new tools module
  * a lot of effort was done to further modularize code
  * fix alignment of status messages for better readability
+ * tool invocations are no longer logged
 
 e2factory-2.3.3
  * use sha1 module instead of calling the sha1sum tool
index 3faeb8fdc7bbebb5c46862d6c3dddd15a8f8efed..d0ffd15d1f359e0be9b988103e6b1bb7b8c7cf4a 100644 (file)
@@ -82,7 +82,6 @@ globals = {
   last_output = false,
   tmpdirs = {},
   tmpfiles = {},
-  enable_invocation_log = false,
   default_projects_server = "projects",
   default_project_version = "2",
   local_e2_branch = nil,
@@ -462,65 +461,6 @@ local function append_to_file(file, line)
   return true, nil
 end
 
---- log tool invocations
--- this function always succeeds or aborts
--- @param info
--- @param args
--- @return nothing
-function log_invocation(info, args)
-  local pname = "<none>"
-  if info then
-    pname = info.name
-  end
-  local logstring = string.format(
-       "%s %s %s %s \"%s %s\"\n",
-       pname, os.date(), buildconfig.VERSIONSTRING,
-       globals.username, arg[0], table.concat(args, " "))
-
-  -- always log to the user logfile
-  local ulogdir = string.format("%s/.e2", globals.homedir)
-  local ulogfile = string.format("%s/run.log", ulogdir)
-  mkdir(ulogdir, "-p")
-  local rc, e = append_to_file(ulogfile, logstring)
-  if not rc then
-    abort(string.format("can't log to file %s: %s", ulogfile, e))
-  end
-
-  -- log to the project logfile
-  if info then
-    local plogdir = string.format("%s/.e2", info.root)
-    local plogfile = string.format("%s/run.log", plogdir)
-    mkdir(plogdir, "-p")
-    rc, e = append_to_file(plogfile, logstring)
-    if not rc then
-      abort(string.format("can't log to file %s: %s", plogfile, e))
-    end
-  end
-
-  -- send the queued logs from the user logfile to the server
-  local args = string.format(
-       "--silent --fail -0 -q -f " ..
-       "--header 'Content-type: text/plain' " ..
-       "--data-binary '@%s' --connect-timeout 1 " ..
-       "'http://e2data:6532/store-run-log.lua?project=%s&user=%s&host=%s' " ..
-       ">/dev/null",
-       ulogfile, pname, globals.username, globals.hostname)
-  local rc = true
-  local re = nil
-  if globals.enable_invocation_log == true then
-    -- really send logs only if enabled
-    rc, re = curl(args)
-  end
-  if not rc then
-    local ulogfile_backup = ulogfile .. ".backup"
-    local args = string.format("'%s' >>'%s'", ulogfile, ulogfile_backup)
-    cat(args)
-    rm(ulogfile, "-f")
-  else
-    log(3, "failed sending queued logs to the server")
-  end
-end
-
 --- exit from the tool, cleaning up temporary files and directories
 -- @param rc number: return code (optional, defaults to 0)
 -- @return This function does not return.
@@ -853,11 +793,6 @@ function use_global_config()
   if not config then
     abort("global config not available")
   end
-  if config.log and config.log.enable ~= nil then
-    globals.enable_invocation_log = config.log.enable
-    log(3, string.format(
-               "globals.enable_invocation_log=%s", tostring(config.log.enable)))
-  end
   if config.log then
     assert_type(config.log, "config.log", "table")
     if config.log.logrotate then
index bc77977d1fa27097e4787e17b8e41aa3d1b7ef10..e955cb64dffa30335e8feeac0b74c7e03cbdc649 100755 (executable)
@@ -58,8 +58,6 @@ if not scache then
   e2lib.abort(e:cat(re))
 end
 
-e2lib.log_invocation(nil, arg)
-
 -- standard global tool setup finished
 
 if e2lib.globals.osenv["E2_LOCAL_TAG"] and e2lib.globals.osenv["E2_LOCAL_BRANCH"] then
index 4da21ef451ea6cc7ac4318c0d787ec5bc7dd15d5..91cde33cd1b0a627a5f949cff8426f282bcf0ac6 100755 (executable)
@@ -61,8 +61,6 @@ if not scache then
   e2lib.abort(e:cat(re))
 end
 
-e2lib.log_invocation(nil, arg)
-
 -- standard global tool setup finished
 
 if #opts.arguments < 1 then
index f533846b546f027e9ee83f1c0eaa9f0df8eb1b28..ddd113f64bed6aa232ead7eb577637a9e43e47dd 100755 (executable)
@@ -59,8 +59,6 @@ if not scache then
   e2lib.abort(e:cat(re))
 end
 
-e2lib.log_invocation(nil, arg)
-
 -- standard global tool setup finished
 
 if #opts.arguments > 0 then
index ed4c018c4035216627ff6da3f875a5fb34ef506e..36b07ccc2cbc15f0790ef8521fa7c1c04c2abb31 100755 (executable)
@@ -59,8 +59,6 @@ for _,res in pairs(info.results) do
        res.build_mode = build_mode
 end
 
-e2lib.log_invocation(info, arg)
-
 -- read build numbers,
 -- merge to results,
 -- flush buildids,
index 83e54b6f3a586327ebe046e77297421018a4a9ac..6f41cc98b245b3159b1f2210fd39dc78da118316 100755 (executable)
@@ -65,8 +65,6 @@ if not rc then
   e2lib.abort(re)
 end
 
-e2lib.log_invocation(info, arg)
-
 -- apply the standard build mode to all results
 for _,res in pairs(info.results) do
        res.build_mode = build_mode
index f0376a154add8fb2646b69aa98780099e49f14a4..431b06478cf0549f8b99d8b493aa630c7c4f4eb2 100755 (executable)
@@ -51,8 +51,6 @@ if not info then
   e2lib.abort(re)
 end
 
-e2lib.log_invocation(info, arg)
-
 if not info.results[ result ] then
   e2lib.abort("no such result: ", result)
 end
index d7991d11389774bccb9ba469164e6e7dd4a40eb8..4dc7eacb6963ed3420106868d9d0003f461b194d 100755 (executable)
@@ -45,8 +45,6 @@ if not info then
   e2lib.abort(re)
 end
 
-e2lib.log_invocation(info, arg)
-
 local d = e2tool.dsort(info)
 if d then
   for i = 1, #d do print(d[i]) end
index d9075eccb8e73b9b16e36688ba74e3e3f04f75f8..930be09ac317833d96c2cd191f8cd17607369303 100755 (executable)
@@ -76,8 +76,6 @@ if not rc then
   e2lib.abort(e:cat(re))
 end
 
-e2lib.log_invocation(info, arg)
-
 if not (opts.fetch or opts.update) then
   opts.fetch = true
   e2lib.warn("WOTHER", "Selecting fetch by default")
index b27b2de7914589a575a22bc335511cb26f5c76fb..3e639c51759542248a66f712032fc22d09e88acb 100755 (executable)
@@ -54,8 +54,6 @@ if not rc then
   e2lib.abort(re)
 end
 
---e2lib.log_invocation(info, arg)
-
 local results = {}
 if opts.all then
   for r, _ in pairs(info.results) do
index 2ef21ed28358c466a4bbe9e2a43a456312040cef..c962285bf10dbdecb8a929d3dd6fde63f6761c49 100644 (file)
@@ -243,8 +243,6 @@ if not info then
   e2lib.abort(re)
 end
 
-e2lib.log_invocation(info, arg)
-
 if opts.git then
   if #opts.arguments ~= 1 then
     e2lib.abort("<name> argument required")
index 9f965f32b9aa430c8bb277d115e45ed63f153fa4..96cef7ad08166552437d17351f0e73b2b2fa7c7c 100644 (file)
@@ -59,8 +59,6 @@ if not rc then
   e2lib.abort(re)
 end
 
-e2lib.log_invocation(info, arg)
-
 if #opts.arguments ~= 1 then
   e2option.usage(1)
 end