Exemple #1
0
	void logToFile(const std::string& file_name)
	{
		LLError::Settings& s = LLError::Settings::get();

		removeRecorder(s.fileRecorder);
		delete s.fileRecorder;
		s.fileRecorder = NULL;
		s.fileRecorderFileName.clear();
		
		if (file_name.empty())
		{
			return;
		}
		
		RecordToFile* f = new RecordToFile(file_name);
		if (!f->okay())
		{
			delete f;
			return;
		}

		s.fileRecorderFileName = file_name;
		s.fileRecorder = f;
		addRecorder(f);
	}
	void logToFile(const std::string& file_name)
	{
		AIAccess<Settings> settings_w(Settings::get());

		removeRecorder(settings_w, settings_w->fileRecorder);
		delete settings_w->fileRecorder;
		settings_w->fileRecorder = NULL;
		settings_w->fileRecorderFileName.clear();
		
		if (file_name.empty())
		{
			return;
		}
		
		RecordToFile* f = new RecordToFile(file_name);
		if (!f->okay())
		{
			delete f;
			return;
		}

		settings_w->fileRecorderFileName = file_name;
		settings_w->fileRecorder = f;
		addRecorder(settings_w, f);
	}
Exemple #3
0
	void logToFixedBuffer(LLFixedBuffer* fixedBuffer)
	{
		LLError::Settings& s = LLError::Settings::get();

		removeRecorder(s.fixedBufferRecorder);
		delete s.fixedBufferRecorder;
		s.fixedBufferRecorder = NULL;
		
		if (!fixedBuffer)
		{
			return;
		}
		
		s.fixedBufferRecorder = new RecordToFixedBuffer(*fixedBuffer);
		addRecorder(s.fixedBufferRecorder);
	}
	void logToFixedBuffer(LLLineBuffer* fixedBuffer)
	{
		AIAccess<Settings> settings_w(Settings::get());

		removeRecorder(settings_w, settings_w->fixedBufferRecorder);
		delete settings_w->fixedBufferRecorder;
		settings_w->fixedBufferRecorder = NULL;
		
		if (!fixedBuffer)
		{
			return;
		}
		
		settings_w->fixedBufferRecorder = new RecordToFixedBuffer(fixedBuffer);
		addRecorder(settings_w, settings_w->fixedBufferRecorder);
	}
	void removeRecorder(Recorder* recorder)
	{
		removeRecorder(AIAccess<Settings>(Settings::get()), recorder);
	}