aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_adhoc.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-07-23 17:32:33 +0100
committerMatthew Wild <mwild1@gmail.com>2012-07-23 17:32:33 +0100
commite89b006f03f692a7e807c54757f0623302c40b85 (patch)
tree9c9c3219211b2f9e2eca26d188f9f44924922db7 /plugins/mod_admin_adhoc.lua
parentbadc4159d600642f97d064a7f74c2ff68dda8abf (diff)
downloadprosody-e89b006f03f692a7e807c54757f0623302c40b85.tar.gz
prosody-e89b006f03f692a7e807c54757f0623302c40b85.zip
Hopefully inert commit to clean up logging across a number of modules, removing all cases of concatenation when building log messages
Diffstat (limited to 'plugins/mod_admin_adhoc.lua')
-rw-r--r--plugins/mod_admin_adhoc.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/mod_admin_adhoc.lua b/plugins/mod_admin_adhoc.lua
index ee89d84f..016eeb4a 100644
--- a/plugins/mod_admin_adhoc.lua
+++ b/plugins/mod_admin_adhoc.lua
@@ -63,15 +63,14 @@ function add_user_command_handler(self, data, state)
return { status = "completed", error = { message = "Account already exists" } };
else
if usermanager_create_user(username, fields.password, host) then
- module:log("info", "Created new account " .. username.."@"..host);
+ module:log("info", "Created new account %s@%s", username, host);
return { status = "completed", info = "Account successfully created" };
else
return { status = "completed", error = { message = "Failed to write data to disk" } };
end
end
else
- module:log("debug", (fields.accountjid or "<nil>") .. " " .. (fields.password or "<nil>") .. " "
- .. (fields["password-verify"] or "<nil>"));
+ module:log("debug", "Invalid data, password mismatch or empty username while creating account for %s", fields.accountjid or "<nil>");
return { status = "completed", error = { message = "Invalid data.\nPassword mismatch, or empty username" } };
end
else
@@ -143,10 +142,10 @@ function delete_user_command_handler(self, data, state)
for _, aJID in ipairs(fields.accountjids) do
local username, host, resource = jid.split(aJID);
if (host == data.to) and usermanager_user_exists(username, host) and disconnect_user(aJID) and usermanager_create_user(username, nil, host) then
- module:log("debug", "User " .. aJID .. " has been deleted");
+ module:log("debug", "User %s has been deleted", aJID);
succeeded[#succeeded+1] = aJID;
else
- module:log("debug", "Tried to delete non-existant user "..aJID);
+ module:log("debug", "Tried to delete non-existant user %s", aJID);
failed[#failed+1] = aJID;
end
end
@@ -165,7 +164,7 @@ function disconnect_user(match_jid)
local sessions = host.sessions[node] and host.sessions[node].sessions;
for resource, session in pairs(sessions or {}) do
if not givenResource or (resource == givenResource) then
- module:log("debug", "Disconnecting "..node.."@"..hostname.."/"..resource);
+ module:log("debug", "Disconnecting %s@%s/%s", node, hostname, resource);
session:close();
end
end