diff options
author | James Moger <james.moger@gitblit.com> | 2013-10-01 17:22:50 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-10-01 17:22:50 -0400 |
commit | 4360b3af73e5e9e575adee9f8d8b462a20445553 (patch) | |
tree | e54c96dea4bc175617d83e8b3cde0df0cbe7c5af /src/main/java | |
parent | cd92bed21e36ec11599da13c3daf0036817a0baf (diff) | |
download | gitblit-4360b3af73e5e9e575adee9f8d8b462a20445553.tar.gz gitblit-4360b3af73e5e9e575adee9f8d8b462a20445553.zip |
Improve message logging in the receive pack
Change-Id: I93dcdc72bfae0e0fac9a0f4872537a43bbd73d36
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/gitblit/git/GitblitReceivePack.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/git/GitblitReceivePack.java b/src/main/java/com/gitblit/git/GitblitReceivePack.java index 090e5416..e6ff5721 100644 --- a/src/main/java/com/gitblit/git/GitblitReceivePack.java +++ b/src/main/java/com/gitblit/git/GitblitReceivePack.java @@ -389,14 +389,22 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P LOGGER.error(text + " (" + user.username + ")");
}
+ protected void sendHeader(String msg, Object... objects) {
+ sendMessage("--->", msg, objects);
+ }
+
protected void sendMessage(String msg, Object... objects) {
+ sendMessage(" ", msg, objects);
+ }
+
+ protected void sendMessage(String prefix, String msg, Object... objects) {
String text;
if (ArrayUtils.isEmpty(objects)) {
text = msg;
- super.sendMessage(msg);
+ super.sendMessage(prefix + msg);
} else {
text = MessageFormat.format(msg, objects);
- super.sendMessage(text);
+ super.sendMessage(prefix + text);
}
LOGGER.info(text + " (" + user.username + ")");
}
@@ -421,7 +429,7 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P * @param commands
* @param scripts
*/
- protected void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {
+ private void runGroovy(Collection<ReceiveCommand> commands, Set<String> scripts) {
if (scripts == null || scripts.size() == 0) {
// no Groovy scripts to execute
return;
|