/* $Id: Debugprint.java 1058 2016-01-17 17:09:20Z shayashi $ */
package smart_gs.debugprint;

import smart_gs.GSVersion;

public class Debugprint {

	static public boolean no_message = false;
	
	public static void message(Object obj) {
		if (Debugprint.no_message) return;
		if (GSVersion.isReleasedVersion()) return;
		StackTraceElement trace = new Throwable().getStackTrace()[1];
		System.out.println("  " + obj + " ("+ trace.getClassName() + ", " + trace.getMethodName() +")");		
	}
	public static void from() {
		if (GSVersion.isReleasedVersion()) return;
		StackTraceElement trace = new Throwable().getStackTrace()[1];
		System.out.println("debug print from " + trace.getClassName() + ", " + trace.getMethodName());
	}
	
	public static void setMessageOff() {
		Debugprint.no_message = true;
	}
	
	public static void setMessageOn() {
		Debugprint.no_message = false;
	}
}