• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LOG_L函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LOG_L函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_L函数的具体用法?C++ LOG_L怎么用?C++ LOG_L使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LOG_L函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LOG_L

IModelDrawer::~IModelDrawer()
{
	eventHandler.RemoveClient(this);

	for (int modelType = MODELTYPE_3DO; modelType < MODELTYPE_OTHER; modelType++) {
		delete opaqueModelRenderers[modelType];
		delete cloakedModelRenderers[modelType];
	}

	opaqueModelRenderers.clear();
	cloakedModelRenderers.clear();

	LOG_L(L_DEBUG, "[%s]", __FUNCTION__);
}
开发者ID:AlexDiede,项目名称:spring,代码行数:14,代码来源:ModelDrawer.cpp


示例2: LOG_L

bool CKeyBindings::SetFakeMetaKey(const std::string& keystr)
{
    CKeySet ks;
    if (StringToLower(keystr) == "none") {
        fakeMetaKey = -1;
        return true;
    }
    if (!ks.Parse(keystr)) {
        LOG_L(L_WARNING, "SetFakeMetaKey: could not parse key: %s", keystr.c_str());
        return false;
    }
    fakeMetaKey = ks.Key();
    return true;
}
开发者ID:spring,项目名称:spring,代码行数:14,代码来源:KeyBindings.cpp


示例3: saveFileName

void CQuitBox::MouseRelease(int x,int y,int button)
{
	float mx=MouseX(x);
	float my=MouseY(y);

	scrolling = false;
	scrollGrab = 0.0f;

	if(InBox(mx,my,box+resignBox)
	   || (InBox(mx,my,box+saveBox) && !teamHandler->Team(gu->myTeam)->isDead)
	   || (InBox(mx,my,box+giveAwayBox) && !teamHandler->Team(shareTeam)->isDead && !teamHandler->Team(gu->myTeam)->isDead)) {
		// give away all units (and resources)
		if(InBox(mx,my,box+giveAwayBox) && !playerHandler->Player(gu->myPlayerNum)->spectator) {
			net->Send(CBaseNetProtocol::Get().SendGiveAwayEverything(gu->myPlayerNum, shareTeam, playerHandler->Player(gu->myPlayerNum)->team));
		}
		// resign, so self-d all units
		if (InBox(mx,my,box+resignBox) && !playerHandler->Player(gu->myPlayerNum)->spectator) {
			net->Send(CBaseNetProtocol::Get().SendResign(gu->myPlayerNum));
		}
		// save current game state
		if (InBox(mx,my,box+saveBox)) {
			if (FileSystem::CreateDirectory("Saves")) {
				std::string timeStr = CTimeUtil::GetCurrentTimeStr();
				std::string saveFileName(timeStr + "_" + modInfo.filename + "_" + gameSetup->mapName);
				saveFileName = "Saves/" + saveFileName + ".ssf";
				if (!FileSystem::FileExists(saveFileName)) {
					LOG("Saving game to %s", saveFileName.c_str());
					ILoadSaveHandler* ls = ILoadSaveHandler::Create();
					ls->mapName = gameSetup->mapName;
					ls->modName = modInfo.filename;
					ls->SaveGame(saveFileName);
					delete ls;
				} else {
					LOG_L(L_ERROR, "File %s already exists, game NOT saved!",
							saveFileName.c_str());
				}
			}
		}
	}
	else if (InBox(mx, my, box + quitBox)) {
		LOG("User exited");
		gu->globalQuit = true;
	}
	// if we're still in the game, remove the resign box
	if(InBox(mx,my,box+resignBox) || InBox(mx,my,box+saveBox) || InBox(mx,my,box+giveAwayBox) || InBox(mx,my,box+cancelBox) || InBox(mx,my,box+quitBox)){
		delete this;
		return;
	}
	moveBox=false;
}
开发者ID:AlexDiede,项目名称:spring,代码行数:50,代码来源:QuitBox.cpp


示例4: LOG_L

CSound::~CSound()
{
	soundThreadQuit = true;
	configHandler->RemoveObserver(this);

	LOG_L(L_INFO, "[%s][1] soundThread=%p", __FUNCTION__, soundThread);

	if (soundThread != NULL) {
		soundThread->join();
		delete soundThread;
		soundThread = NULL;
	}

	LOG_L(L_INFO, "[%s][2]", __FUNCTION__);

	for (soundVecT::iterator it = sounds.begin(); it != sounds.end(); ++it)
		delete *it;

	sounds.clear();
	SoundBuffer::Deinitialise();

	LOG_L(L_INFO, "[%s][3]", __FUNCTION__);
}
开发者ID:304471720,项目名称:spring,代码行数:23,代码来源:Sound.cpp


示例5: LOG_L

void Gui::Draw()
{
	for (ElList::iterator it = toBeAdded.begin(); it != toBeAdded.end(); ++it)
	{
		bool duplicate = false;
		for (ElList::iterator elIt = elements.begin(); elIt != elements.end(); ++elIt)
		{
			if (it->element == elIt->element)
			{
				LOG_L(L_DEBUG, "Gui::AddElement: skipping duplicated object");
				duplicate = true;
				break;
			}
		}
		if (!duplicate)
		{
			if (it->asBackground)
				elements.push_back(*it);
			else
				elements.push_front(*it);
		}
	}
	toBeAdded.clear();

	for (ElList::iterator it = toBeRemoved.begin(); it != toBeRemoved.end(); ++it)
	{
		for (ElList::iterator elIt = elements.begin(); elIt != elements.end(); ++elIt)
		{
			if (it->element == elIt->element)
			{
				delete (elIt->element);
				elements.erase(elIt);
				break;
			}
		}
	}
	toBeRemoved.clear();

	glDisable(GL_TEXTURE_2D);
	glDisable(GL_ALPHA_TEST);
	glEnable(GL_BLEND);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(0, 1, 0, 1);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	for (ElList::reverse_iterator it = elements.rbegin(); it != elements.rend(); ++it) {
		(*it).element->Draw();
	}
}
开发者ID:DarksidedStudios,项目名称:spring,代码行数:50,代码来源:Gui.cpp


示例6: switch

//A thread wants to continue running at a later time, and adds itself to the scheduler
void CCobEngine::AddThread(CCobThread *thread)
{
	switch (thread->state) {
		case CCobThread::Run:
			wantToRun.push_front(thread);
			break;
		case CCobThread::Sleep:
			sleeping.push(thread);
			break;
		default:
			LOG_L(L_ERROR, "thread added to scheduler with unknown state (%d)", thread->state);
			break;
	}
}
开发者ID:DarksidedStudios,项目名称:spring,代码行数:15,代码来源:CobEngine.cpp


示例7: SuspendedStacktrace

	/**
	 *
     * This entry point is tailored for the Watchdog module.
     * Since the thread to be traced may be running, it requires a ThreadControls object in order to suspend/resume the thread.
     * @brief RemoteStacktrace
     */
    void SuspendedStacktrace(Threading::ThreadControls* ctls, const std::string& threadName)
    {
#if !(DEDICATED || UNIT_TEST)
        Watchdog::ClearTimer();
#endif
        assert(ctls != nullptr);
        assert(ctls->handle != 0);
        assert(threadName.size() > 0);

        LOG_L(L_WARNING, "Suspended-thread Stacktrace (%s) for Spring %s:", threadName.c_str(), (SpringVersion::GetFull()).c_str());

        LOG_L(L_DEBUG, "SuspendedStacktrace[1]");

        StackTrace stacktrace;

        // Get untranslated stacktrace symbols
        {
            // process and analyse the raw stack trace
            void* iparray[MAX_STACKTRACE_DEPTH];

			ctls->Suspend();

			const int numLines = thread_unwind(&ctls->ucontext, iparray, stacktrace);

			ctls->Resume();

            LOG_L(L_DEBUG, "SuspendedStacktrace[2]");

            if(numLines > MAX_STACKTRACE_DEPTH) {
                LOG_L(L_ERROR, "thread_unwind returned more lines than we allotted space for!");
            }
            char** lines = backtrace_symbols(iparray, numLines); // give them meaningfull names

            ExtractSymbols(lines, stacktrace);
        }

        if (stacktrace.empty()) {
            LOG_L(L_WARNING, "  Unable to create suspended stacktrace");
            return;
        }

        LOG_L(L_DEBUG, "SuspendedStacktrace[3]");

        // Translate symbols into code line numbers
        TranslateStackTrace(NULL, stacktrace, LOG_LEVEL_WARNING);

        LOG_L(L_DEBUG, "SuspendedStacktrace[4]");

        // Print out the translated StackTrace
        LogStacktrace(LOG_LEVEL_WARNING, stacktrace);

    }
开发者ID:GHackAnonymous,项目名称:spring,代码行数:58,代码来源:CrashHandler.cpp


示例8: lck

void CSound::PrintDebugInfo()
{
	boost::recursive_mutex::scoped_lock lck(soundMutex);

	LOG_L(L_DEBUG, "OpenAL Sound System:");
	LOG_L(L_DEBUG, "# SoundSources: %i", (int)sources.size());
	LOG_L(L_DEBUG, "# SoundBuffers: %i", (int)SoundBuffer::Count());

	LOG_L(L_DEBUG, "# reserved for buffers: %i kB", (int)(SoundBuffer::AllocedSize() / 1024));
	LOG_L(L_DEBUG, "# PlayRequests for empty sound: %i", numEmptyPlayRequests);
	LOG_L(L_DEBUG, "# Samples disrupted: %i", numAbortedPlays);
	LOG_L(L_DEBUG, "# SoundItems: %i", (int)sounds.size());
}
开发者ID:304471720,项目名称:spring,代码行数:13,代码来源:Sound.cpp


示例9: TestCregClasses2

static bool TestCregClasses2()
{
	PreCregTest("CREG: Test2 (Class' Sizes)");

	int fineClasses = 0;
	int brokenClasses = 0;

	const std::vector<creg::Class*>& cregClasses = creg::System::GetClasses();
	for (std::vector<creg::Class*>::const_iterator it = cregClasses.begin(); it != cregClasses.end(); ++it) {
		const creg::Class* c = *it;

		const std::string& className = c->name;
		const size_t classSize = c->size;

		size_t cregSize = 1; // c++ class is min. 1byte large (part of sizeof definition)

		const creg::Class* c_base = c;
		while (c_base){
			const std::vector<creg::Class::Member*>& classMembers = c_base->members;
			for (std::vector<creg::Class::Member*>::const_iterator jt = classMembers.begin(); jt != classMembers.end(); ++jt) {
				const size_t memberOffset = (*jt)->offset;
				const size_t typeSize = (*jt)->type->GetSize();
				cregSize = std::max(cregSize, memberOffset + typeSize);
			}

			c_base = c_base->base;
		}

		// alignment padding
		const float alignment = c->alignment;
		cregSize = std::ceil(cregSize / alignment) * alignment; //FIXME too simple, gcc's appending rules are ways more complicated

		if (cregSize != classSize) {
			brokenClasses++;
			LOG_L(L_WARNING, "  Missing member(s) in class %s, real size %u, creg size %u", className.c_str(), classSize, cregSize);
			/*for (std::vector<creg::Class::Member*>::const_iterator jt = classMembers.begin(); jt != classMembers.end(); ++jt) {
				const std::string memberName   = (*jt)->name;
				const size_t      memberOffset = (*jt)->offset;
				const std::string typeName = (*jt)->type->GetName();
				const size_t      typeSize = (*jt)->type->GetSize();
				LOG_L(L_WARNING, "  member %20s, type %12s, offset %3u, size %u", memberName.c_str(), typeName.c_str(), memberOffset, typeSize);
			}*/
		} else {
			//LOG( "CREG: Class %s fine, size %u", className.c_str(), classSize);
			fineClasses++;
		}
	}
	return PostCregTest(fineClasses, brokenClasses, 15);
}
开发者ID:AMDmi3,项目名称:spring,代码行数:49,代码来源:creg_runtime_tests.cpp


示例10: CCannon

CWeapon* CWeaponLoader::LoadWeapon(CUnit* owner, const UnitDefWeapon* defWeapon)
{
	CWeapon* weapon = NULL;

	const WeaponDef* weaponDef = defWeapon->def;
	const std::string& weaponType = weaponDef->type;

	if (weaponType == "Cannon") {
		weapon = new CCannon(owner, weaponDef);
	} else if (weaponType == "Rifle") {
		weapon = new CRifle(owner, weaponDef);
	} else if (weaponType == "Melee") {
		weapon = new CMeleeWeapon(owner, weaponDef);
	} else if (weaponType == "Shield") {
		weapon = new CPlasmaRepulser(owner, weaponDef);
	} else if (weaponType == "Flame") {
		weapon = new CFlameThrower(owner, weaponDef);
	} else if (weaponType == "MissileLauncher") {
		weapon = new CMissileLauncher(owner, weaponDef);
	} else if (weaponType == "AircraftBomb") {
		weapon = new CBombDropper(owner, weaponDef, false);
	} else if (weaponType == "TorpedoLauncher") {
		if (owner->unitDef->canfly && !weaponDef->submissile) {
			weapon = new CBombDropper(owner, weaponDef, true);
		} else {
			weapon = new CTorpedoLauncher(owner, weaponDef);
		}
	} else if (weaponType == "LaserCannon") {
		weapon = new CLaserCannon(owner, weaponDef);
	} else if (weaponType == "BeamLaser") {
		weapon = new CBeamLaser(owner, weaponDef);
	} else if (weaponType == "LightningCannon") {
		weapon = new CLightningCannon(owner, weaponDef);
	} else if (weaponType == "EmgCannon") {
		weapon = new CEmgCannon(owner, weaponDef);
	} else if (weaponType == "DGun") {
		// NOTE: no special connection to UnitDef::canManualFire
		// (any type of weapon may be slaved to the button which
		// controls manual firing) or the CMD_MANUALFIRE command
		weapon = new CDGunWeapon(owner, weaponDef);
	} else if (weaponType == "StarburstLauncher") {
		weapon = new CStarburstLauncher(owner, weaponDef);
	} else {
		weapon = new CNoWeapon(owner, weaponDef);
		LOG_L(L_ERROR, "weapon-type %s unknown or NOWEAPON", weaponType.c_str());
	}

	return weapon;
}
开发者ID:jamerlan,项目名称:spring,代码行数:49,代码来源:WeaponLoader.cpp


示例11: sprintf

void CGameSetup::LoadAllyTeams(const TdfParser& file)
{
	// i = allyteam index in game (no gaps), a = allyteam index in script
	int i = 0;
	for (int a = 0; a < MAX_TEAMS; ++a) {
		char section[50];
		sprintf(section,"GAME\\ALLYTEAM%i",a);
		string s(section);

		if (!file.SectionExist(s))
			continue;

		AllyTeam data;
		std::map<std::string, std::string> setup = file.GetAllValues(s);

		for (std::map<std::string, std::string>::const_iterator it = setup.begin(); it != setup.end(); ++it)
			data.SetValue(it->first, it->second);

		allyStartingData.push_back(data);

		allyteamRemap[a] = i;
		++i;
	}

	{
		const size_t numAllyTeams = allyStartingData.size();
		for (size_t a = 0; a < numAllyTeams; ++a) {
			allyStartingData[a].allies.resize(numAllyTeams, false);
			allyStartingData[a].allies[a] = true; // each team is allied with itself

			std::ostringstream section;
			section << "GAME\\ALLYTEAM" << a << "\\";

			const size_t numAllies = atoi(file.SGetValueDef("0", section.str() + "NumAllies").c_str());

			for (size_t b = 0; b < numAllies; ++b) {
				std::ostringstream key;
				key << "GAME\\ALLYTEAM" << a << "\\Ally" << b;
				const int other = atoi(file.SGetValueDef("0",key.str()).c_str());
				allyStartingData[a].allies[allyteamRemap[other]] = true;
			}
		}
	}

	unsigned allyCount = 0;
	if (file.GetValue(allyCount, "GAME\\NumAllyTeams") && (allyStartingData.size() != allyCount)) {
		LOG_L(L_WARNING, "Incorrect number of ally teams in GameSetup script");
	}
}
开发者ID:amitamitamitamit,项目名称:spring,代码行数:49,代码来源:GameSetup.cpp


示例12: LOG_L

int CSkirmishAILibrary::HandleEvent(int skirmishAIId, int topic, const void* data) const
{
	int ret = sSAI.handleEvent(skirmishAIId, topic, data);

	if (ret != 0) {
		// event handling failed!
		const int teamId = skirmishAIHandler.GetSkirmishAI(skirmishAIId)->team;
		LOG_L(L_WARNING,
			"AI for team %i (ID: %i) failed handling event with topic %i, error: %i",
			teamId, skirmishAIId, topic, ret
		);
	}

	return ret;
}
开发者ID:lordelven,项目名称:spring,代码行数:15,代码来源:SkirmishAILibrary.cpp


示例13: sSAI

CSkirmishAILibrary::CSkirmishAILibrary(const SSkirmishAILibrary& ai,
		const SkirmishAIKey& key)
		: sSAI(ai), key(key) {

	if (sSAI.handleEvent == NULL) {
		LOG_L(L_ERROR,
				"Fetched AI library %s-%s has no handleEvent function"
				"available. It is therefore illegal and will not be used."
				"This usually indicates a problem in the used AI Interface"
				"library (%s-%s).",
				key.GetShortName().c_str(), key.GetVersion().c_str(),
				key.GetInterface().GetShortName().c_str(),
				key.GetInterface().GetVersion().c_str());
	}
}
开发者ID:lordelven,项目名称:spring,代码行数:15,代码来源:SkirmishAILibrary.cpp


示例14: CEventClient

IModelDrawer::IModelDrawer(const std::string& name, int order, bool synced): CEventClient(name, order, synced)
{
	eventHandler.AddClient(this);

	opaqueModelRenderers.resize(MODELTYPE_OTHER, NULL);
	cloakedModelRenderers.resize(MODELTYPE_OTHER, NULL);

	for (int modelType = MODELTYPE_3DO; modelType < MODELTYPE_OTHER; modelType++) {
		opaqueModelRenderers[modelType] = IWorldObjectModelRenderer::GetInstance(modelType);
		cloakedModelRenderers[modelType] = IWorldObjectModelRenderer::GetInstance(modelType);
	}

	LOG_L(L_DEBUG, "[%s] this=%p, name=%s, order=%d, synced=%d",
			__FUNCTION__, this, name.c_str(), order, synced);
}
开发者ID:AlexDiede,项目名称:spring,代码行数:15,代码来源:ModelDrawer.cpp


示例15: ClearTimer

	void ClearTimer(const std::string &name, bool disable)
	{
		if (hangDetectorThread == NULL)
			return; //! Watchdog isn't running

		std::map<std::string, unsigned int>::iterator i = threadNameToNum.find(name);
		unsigned int num;
		WatchDogThreadInfo* th_info;
		if (i == threadNameToNum.end() || (num = i->second) >= WDT_LAST || !(th_info = registeredThreads[num])->numreg) {
			LOG_L(L_ERROR, "[Watchdog::ClearTimer] Invalid thread name");
			return;
		}

		th_info->timer = disable ? spring_notime : spring_gettime();
	}
开发者ID:jamerlan,项目名称:spring,代码行数:15,代码来源:Watchdog.cpp


示例16: GML_RECMUTEX_LOCK

void CGroupHandler::RemoveGroup(CGroup* group)
{
	GML_RECMUTEX_LOCK(grpsel); // RemoveGroup

	if (group->id < FIRST_SPECIAL_GROUP) {
		LOG_L(L_WARNING, "Trying to remove hot-key group %i", group->id);
		return;
	}
	if (selectedUnits.selectedGroup == group->id) {
		selectedUnits.ClearSelected();
	}
	groups[group->id] = NULL;
	freeGroups.push_back(group->id);
	delete group;
}
开发者ID:FriedRice,项目名称:spring,代码行数:15,代码来源:GroupHandler.cpp


示例17: SendTeamStats

bool COSCStatsSender::Update(int frameNum) {

	if (IsEnabled() && IsTimeToSend(frameNum)) {
		try {
			// Try to send team stats first, as they are more important,
			// more interesting.
			return SendTeamStats() && SendPlayerStats();
		} catch (const boost::system::system_error& ex) {
			LOG_L(L_ERROR, "Failed sending OSC Stats init: %s", ex.what());
			return false;
		}
	} else {
		return false;
	}
}
开发者ID:Finkky,项目名称:spring,代码行数:15,代码来源:OSCStatsSender.cpp


示例18: SendInitialInfo

bool COSCStatsSender::SendInit() {

	if (IsEnabled()) {
		try {
			return SendInitialInfo()
					&& SendTeamStatsTitles()
					&& SendPlayerStatsTitles();
		} catch (const boost::system::system_error& ex) {
			LOG_L(L_ERROR, "Failed sending OSC Stats init: %s", ex.what());
			return false;
		}
	} else {
		return false;
	}
}
开发者ID:Finkky,项目名称:spring,代码行数:15,代码来源:OSCStatsSender.cpp


示例19: info_parseInfoItem

static bool info_parseInfoItem(const LuaTable& root, int index, InfoItem& inf,
		std::set<string>& infoSet)
{
	const LuaTable& infsTbl = root.SubTable(index);
	if (!infsTbl.IsValid()) {
		LOG_L(L_WARNING, "parseInfoItem: subtable %d invalid", index);
		return false;
	}

	// common info properties
	inf.key = infsTbl.GetString("key", "");
	if (inf.key.empty()
			|| (inf.key.find_first_of(InfoItem_badKeyChars) != string::npos)) {
		LOG_L(L_WARNING,
				"parseInfoItem: empty key or key contains bad characters");
		return false;
	}
	std::string lowerKey = StringToLower(inf.key);
	if (infoSet.find(inf.key) != infoSet.end()) {
		LOG_L(L_WARNING, "parseInfoItem: key toLowerCase(%s) exists already",
				inf.key.c_str());
		return false;
	}
	// TODO add support for info value types other then string
	inf.valueType = INFO_VALUE_TYPE_STRING;
	inf.valueTypeString = infsTbl.GetString("value", "");
	if (inf.valueTypeString.empty()) {
		LOG_L(L_WARNING, "parseInfoItem: %s: empty value", inf.key.c_str());
		return false;
	}
	inf.desc = infsTbl.GetString("desc", "");

	infoSet.insert(lowerKey);

	return true;
}
开发者ID:304471720,项目名称:spring,代码行数:36,代码来源:Info.cpp


示例20: fgets_addr2line

static char* fgets_addr2line(char* line, int maxLength, FILE* cmdOut)
{
    char* res = fgets(line, maxLength, cmdOut);
    if (res) {
        int sz = strnlen(line, maxLength);
        if (line[sz-1] == '\n') {
            line[sz-1] = 0;// exclude the line-ending
        }
    } else {
        line[0] = 0;
    }
    LOG_L(L_DEBUG, "addr2line: %s", line);

    return res;
}
开发者ID:GHackAnonymous,项目名称:spring,代码行数:15,代码来源:CrashHandler.cpp



注:本文中的LOG_L函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LOG_MASK函数代码示例发布时间:2022-05-30
下一篇:
C++ LOG_INVALID函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap