summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/ClientLogger.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/utils/ClientLogger.java')
-rw-r--r--src/com/gitblit/utils/ClientLogger.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/ClientLogger.java b/src/com/gitblit/utils/ClientLogger.java
new file mode 100644
index 00000000..2e16fd15
--- /dev/null
+++ b/src/com/gitblit/utils/ClientLogger.java
@@ -0,0 +1,32 @@
+package com.gitblit.utils;
+
+import org.eclipse.jgit.transport.ReceivePack;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class to log messages to the pushing client. Intended to be used by
+ * the Groovy Hooks.
+ *
+ * @author jcrygier
+ *
+ */
+public class ClientLogger {
+
+ static final Logger logger = LoggerFactory.getLogger(ClientLogger.class);
+ private ReceivePack rp;
+
+ public ClientLogger(ReceivePack rp) {
+ this.rp = rp;
+ }
+
+ /**
+ * Sends a message to the git client. Useful for sending INFO / WARNING messages.
+ *
+ * @param message
+ */
+ public void sendMessage(String message) {
+ rp.sendMessage(message);
+ }
+
+}