Software / code / prosody
Comparison
plugins/mod_posix.lua @ 4993:5243b74a4cbb
Hopefully inert commit to clean up logging across a number of modules, removing all cases of concatenation when building log messages
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 23 Jul 2012 17:32:33 +0100 |
| parent | 4797:e239668aa6d2 |
| child | 5175:fabaed7418a6 |
comparison
equal
deleted
inserted
replaced
| 4992:e79e4d1f75de | 4993:5243b74a4cbb |
|---|---|
| 32 local uid = module:get_option("setuid"); | 32 local uid = module:get_option("setuid"); |
| 33 local gid = module:get_option("setgid"); | 33 local gid = module:get_option("setgid"); |
| 34 if gid then | 34 if gid then |
| 35 local success, msg = pposix.setgid(gid); | 35 local success, msg = pposix.setgid(gid); |
| 36 if success then | 36 if success then |
| 37 module:log("debug", "Changed group to "..gid.." successfully."); | 37 module:log("debug", "Changed group to %s successfully.", gid); |
| 38 else | 38 else |
| 39 module:log("error", "Failed to change group to "..gid..". Error: "..msg); | 39 module:log("error", "Failed to change group to %s. Error: %s", gid, msg); |
| 40 prosody.shutdown("Failed to change group to "..gid); | 40 prosody.shutdown("Failed to change group to %s", gid); |
| 41 end | 41 end |
| 42 end | 42 end |
| 43 if uid then | 43 if uid then |
| 44 local success, msg = pposix.setuid(uid); | 44 local success, msg = pposix.setuid(uid); |
| 45 if success then | 45 if success then |
| 46 module:log("debug", "Changed user to "..uid.." successfully."); | 46 module:log("debug", "Changed user to %s successfully.", uid); |
| 47 else | 47 else |
| 48 module:log("error", "Failed to change user to "..uid..". Error: "..msg); | 48 module:log("error", "Failed to change user to %s. Error: %s", uid, msg); |
| 49 prosody.shutdown("Failed to change user to "..uid); | 49 prosody.shutdown("Failed to change user to %s", uid); |
| 50 end | 50 end |
| 51 end | 51 end |
| 52 end); | 52 end); |
| 53 | 53 |
| 54 -- Don't even think about it! | 54 -- Don't even think about it! |