Subversion Repositories eFlore/Applications.coel

Rev

Rev 1896 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
883 jpm 1
package org.tela_botanica.client.util;
2
 
3
import com.google.gwt.core.client.GWT;
1633 aurelien 4
import com.google.gwt.user.client.Window;
883 jpm 5
 
6
public class Debug {
7
 
1564 jpm 8
	@Deprecated
883 jpm 9
	public static void log(String texte) {
10
		GWT.log(texte, null);
11
	}
1633 aurelien 12
 
13
	public static String getStackTraceAsString(int depth) {
14
		// a décommenter lors de l'utilisation car ne fonctionne qu'en mode
15
		// hosted et pas en mode compilé
1637 aurelien 16
		/*StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
1633 aurelien 17
		String trace = "";
1637 aurelien 18
		for (int i = 2; i < stackTraceElements.length && i < depth+2; i++) {
19
			if(i != 2) {
1633 aurelien 20
				trace += " < ";
21
			}
22
			trace += stackTraceElements[i].getClassName()+"."+stackTraceElements[i].getMethodName();
23
		}
1637 aurelien 24
		return trace;*/
1633 aurelien 25
		return "";
26
	}
27
 
1896 aurelien 28
	public static native void  LogVersFirebug(Object o) /*-{
29
		if (!!($wnd.console && $wnd.console.log)) {
30
			console.log(o);
31
		}
32
	}-*/;
33
 
883 jpm 34
}