예제 #1
0
Log::~Log()
{
	if( gs_Log == this ) LogSetDefault(nullptr);

	TimerDestroy(timer);
	MutexDestroy(mutex);
}
예제 #2
0
파일: Log.cpp 프로젝트: FloodProject/flood
Log::Log()
{
	Allocator* alloc = AllocatorGetThis();


	LogAddHandler(this, LogConsoleHandler);

	if( !gs_Log ) LogSetDefault(this);
}
예제 #3
0
Log::Log()
	: timer(nullptr)
	, mutex(nullptr)
{
	Allocator* alloc = AllocatorGetThis();

	timer = TimerCreate(alloc);
	mutex = MutexCreate(alloc);

	LogAddHandler(this, LogConsoleHandler);

	if( !gs_Log ) LogSetDefault(this);
}
예제 #4
0
int main(int argc, char** argv)
{
	int ret = EXIT_SUCCESS;

	// Setup default error handling strategy.
	// ...

	// Setup the default log stream.
	Log logger;
	LogSetDefault(&logger);

	// Setup the command line handling.
	AnyOption options;

	// Use this to active debug mode.
	options.setFlag("debug", 'd');

	options.setVerbose();
	options.autoUsagePrint(true);

	// Process the command line arguments.
	options.processCommandArgs(argc, argv);

	String file;
	ret = ValidateOptions(options, file);

	if( ret != EXIT_SUCCESS )
	{
		options.printUsage();
		return ret;
	}

	Runtime runtime;
	runtime.init();
	runtime.shutdown();

	return ret;
}
예제 #5
0
파일: Log.cpp 프로젝트: FloodProject/flood
Log::~Log()
{
	if( gs_Log == this ) LogSetDefault(nullptr);

}