summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/ClientLogger.java
blob: 2e16fd15ffa9a1f1f1e06c2bea03998fdd61f177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
	}
	
}