
var gConsole = new ErrorConsole();

function ErrorConsole()
{
	this.kLog = 9;
	
	this.Log = function(level, message)
	{
		if(level <= this.kLog)
		{
			if(typeof console != "undefined")
			{
				console.log(message);
			}
			var urlVars = getUrlVars();
			if(urlVars["visualconsole"])
			{
				gDraw.WatchLog(message);
			}
		}
	}

	
	this.AssertNow = function(message)
	{
		if(!gCommands)
		{
			alert("Assert " + message);
		}
		else
		{
			gConsole.Log(1, "[ASSERT] " + message);
		}
	}

	
	this.Assert = function(condition)
	{
		if(!condition)
		{
			this.AssertNow(condition);
		}
	}

	
	this.AssertMsg = function(condition, message)
	{
		if(!condition)
		{
			this.AssertNow(message);
		}
	}
}



