]> source.dussan.org Git - gitblit.git/commitdiff
Improve message logging in the receive pack
authorJames Moger <james.moger@gitblit.com>
Tue, 1 Oct 2013 21:22:50 +0000 (17:22 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 1 Oct 2013 21:22:50 +0000 (17:22 -0400)
Change-Id: I93dcdc72bfae0e0fac9a0f4872537a43bbd73d36

src/main/java/com/gitblit/git/GitblitReceivePack.java

index 090e54169f7cf82a12f662b306a610c6be570430..e6ff5721c0051e66ef3acf373cfa5ae8a1ab22b4 100644 (file)
@@ -389,14 +389,22 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P
                LOGGER.error(text + " (" + user.username + ")");\r
        }\r
 \r
+       protected void sendHeader(String msg, Object... objects) {\r
+               sendMessage("--->", msg, objects);\r
+       }\r
+\r
        protected void sendMessage(String msg, Object... objects) {\r
+               sendMessage("    ", msg, objects);\r
+       }\r
+\r
+       protected void sendMessage(String prefix, String msg, Object... objects) {\r
                String text;\r
                if (ArrayUtils.isEmpty(objects)) {\r
                        text = msg;\r
-                       super.sendMessage(msg);\r
+                       super.sendMessage(prefix + msg);\r
                } else {\r
                        text = MessageFormat.format(msg, objects);\r
-                       super.sendMessage(text);\r
+                       super.sendMessage(prefix + text);\r
                }\r
                LOGGER.info(text + " (" + user.username + ")");\r
        }\r
@@ -421,7 +429,7 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P
         * @param commands\r
         * @param scripts\r
         */\r
-       protected void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {\r
+       private void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {\r
                if (scripts == null || scripts.size() == 0) {\r
                        // no Groovy scripts to execute\r
                        return;\r