/*
systym: the NIH-syndrome javascript library
copyright (c) 2009 Chris Rose-Mathew
*/

//===================================================
// class: Log
//===================================================
// This class allows you to perform diagnostic logging
// of program functions and tasks
//===================================================
function Log(containerDivId)
{
	//Properties
	this.logging = false;
	this.container = document.getElementById(containerDivId);
	if (!this.container)
	{
		alert("ERROR - failed to find logging container");
	}
	
	//=================================================
	// addItem()
	//=================================================
	// Log a text string to the output paragraph
	// on the page
	//=================================================
	this.addItem = function(logItemText)
	{
		if (this.logging)
		{
			var entry = document.createTextNode(logItemText);

			var newline = document.createElement("p");
			newline.appendChild(entry);
		
			this.container.appendChild(newline);
		}
	}
}

