summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2013-10-02 18:37:07 +0100
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2013-10-02 18:37:07 +0100
commit1f5949b45b5305978187d4ed188fbe951a5610b3 (patch)
tree3f2cefdecf28718281e5000b6ef7bf0f0a963105
parenta0f3280392586224ba4ef4e12ff3028972f8989f (diff)
downloadgitano-1f5949b45b5305978187d4ed188fbe951a5610b3.tar.bz2
Add syslogging to gitano-pre-receive-hook
-rw-r--r--bin/gitano-pre-receive-hook.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/gitano-pre-receive-hook.in b/bin/gitano-pre-receive-hook.in
index 6eae987..c25418b 100644
--- a/bin/gitano-pre-receive-hook.in
+++ b/bin/gitano-pre-receive-hook.in
@@ -23,6 +23,7 @@ local start_log_level = gitano.log.get_level()
-- Clamp level at info until we have checked if the caller
-- is an admin or not
gitano.log.cap_level(gitano.log.level.INFO)
+gitano.log.syslog.open()
local repo_root = luxio.getenv("GITANO_ROOT")
local username = luxio.getenv("GITANO_USER") or "gitano/anonymous"
@@ -74,7 +75,7 @@ if repo.is_nascent then
gitano.log.fatal("Repository " .. repo.name .. " is nascent")
end
--- pre-receive is can prevent updates. Its name is a bit misleading.
+-- pre-receive can prevent updates. Its name is a bit misleading.
-- pre-receive is called once all the objects have been pushed, but before the
-- individual update hooks are called. It gets the same input as post-receive
-- but can opt to reject the entire push. If you need to make decisions based
@@ -91,7 +92,12 @@ end
if repo:uses_hook("pre-receive") then
gitano.log.debug("Configuring for pre-receive hook")
gitano.actions.set_supple_globals("pre-receive")
- gitano.log.info("Running repository pre-receive hook")
+
+ local msg = "Running repository pre-receive hook"
+
+ gitano.log.info(msg)
+ gitano.log.syslog.info(msg)
+
local info = {
username = username,
keytag = keytag,
@@ -106,4 +112,6 @@ if repo:uses_hook("pre-receive") then
gitano.log.info("Finished")
end
+gitano.log.syslog.close()
+
return 0