/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/sgx/core/helpers/outputtrace.cpp

*/

#include "sgx/core/types/types.hpp"
#include "sgx/core/stl/stl.hpp"
#include "sgx/core/helpers/trace.hpp"


cbfnOutputTrace pcbOutputTrace;


/**
Specify the method to invoke whenever a message should be made visible
to the output/trace/debug window. 

The determination of whether the message is important enough to be
seen (i.e. is it an error/warning/etc) by CTraceModule
*/ 
void sgxRegisterOutputTrace(const cbfnOutputTrace pfn)
{
	pcbOutputTrace = pfn;
}

/**
The lowest level trace method. CTraceModule calls this to write trace
information.
*/
void sgxOutputTraceMessage(const char *pMessage)
{
	if (pcbOutputTrace) {
		(*pcbOutputTrace)(pMessage);
	}
}

