当前位置: 首页>>代码示例>>C++>>正文


C++ TLOG函数代码示例

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


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

示例1: initIdDict

/**
 * 初始化 nid->docId的字典 和 deletemap
 *
 * @param path     数据存放路径
 *
 * @return  0: success ;   -1: 程序处理失败
 */
int initIdDict(const char * path, bool sync = true)
{
    DocIdManager * mgr = DocIdManager::getInstance();

    if ( NULL == mgr )
    {
        TERR("DocIdManager instance is null");
        return -1;
    }

    if ( (NULL == path) || strlen( path ) <= 0 )
    {
        TERR("idDict node's path attribute is null");
        return -1;
    }

    TLOG("begin to load nid->docId dict and deleteMap! path:%s", path);

    mgr->setDataSync( sync );
    if ( false == mgr->load( path ) )
    {
        TERR("load nid->docId dict and deleteMap failed! path:%s", path);
        return -1;
    }

    TLOG("load nid->docId dict and deleteMap success!");

    return 0;
}
开发者ID:sdgdsffdsfff,项目名称:kingso,代码行数:36,代码来源:IndexLib.cpp

示例2: TLOG

void toAWR::instanceChanged(int pos)
{
	QVariant d = dbid->itemData(pos);
	QStringList l = d.toStringList();
	std::stringstream s;
	for(QList<QString>::iterator i=l.begin(); i!=l.end(); ++i)
	{
		s << ":\'" << (*i).toAscii().constData() << '\'';
	}
	TLOG(0,toDecorator,__HERE__) << "Instance changed:" << pos << s.str() << std::endl;
	QString dbid = l.at(0);
	QString inst = l.at(1);
	try
	{
		toQList sparams, eparams;
		sparams.push_back(dbid);
		sparams.push_back(inst);
		sparams.push_back(startdate->date().toString("yyyy:MM:dd"));
		sparams.push_back(startdate->date().toString("yyyy:MM:dd"));
		TLOG(1,toDecorator,__HERE__) << "FSNAP: ("  << sparams.size() << ")" << std::endl;
		fsnap->query(toSQL::sql("toAWR:Snaps", connection()), const_cast<const toQList&>(sparams ) );
		fsnap->refresh();
		eparams.push_back(dbid);
		eparams.push_back(inst);
		eparams.push_back(enddate->date().toString("yyyy:MM:dd"));
		eparams.push_back(enddate->date().toString("yyyy:MM:dd"));
		TLOG(1,toDecorator,__HERE__) << "TSNAP: ("  << eparams.size() << ")" << std::endl;
		tsnap->query(toSQL::sql("toAWR:Snaps", connection()), const_cast<const toQList&>(eparams ) );
		tsnap->refresh();
	}
	TOCATCH;
};
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:32,代码来源:toawr.cpp

示例3: TLOG

void toAWR::instanceChanged(int pos)
{
    QVariant d = dbid->itemData(pos);
    QStringList l = d.toStringList();
    std::stringstream s;
    for (QList<QString>::iterator i = l.begin(); i != l.end(); ++i)
    {
        s << ":\'" << (*i).toLatin1().constData() << '\'';
    }
    TLOG(0, toDecorator, __HERE__) << "Instance changed:" << pos << s.str() << std::endl;
    QString dbid = l.at(0);
    QString inst = l.at(1);
    try
    {
        toQueryParams sparams, eparams;
        sparams <<  dbid << inst << startdate->date().toString("yyyy:MM:dd") << startdate->date().toString("yyyy:MM:dd");
        TLOG(1, toDecorator, __HERE__) << "FSNAP: ("  << sparams.size() << ")" << std::endl;
        fsnap->refreshWithParams(sparams);


        eparams << dbid << inst << enddate->date().toString("yyyy:MM:dd") << enddate->date().toString("yyyy:MM:dd");
        TLOG(1, toDecorator, __HERE__) << "TSNAP: ("  << eparams.size() << ")" << std::endl;
        tsnap->refreshWithParams(eparams);
    }
    TOCATCH;
};
开发者ID:doniexun,项目名称:tora,代码行数:26,代码来源:toawr.cpp

示例4: initIncIndex

/**
 * 初始化 增量 index
 *
 * @param path     数据存放路径
 *
 * @return  0: success ;   -1: 程序处理失败
 */
int initIncIndex(const char * path, bool sync, bool et, int32_t inc_max_num )
{
    IndexIncManager * mgr = IndexIncManager::getInstance();

    if ( NULL == mgr )
    {
        TERR("IndexIncManager instance is null");
        return -1;
    }

    if ( (NULL == path) || strlen( path ) <= 0 )
    {
        TERR("index node's path attribute is null");
        return -1;
    }

    TLOG("begin to load inc index! path:%s", path);

    mgr->setDataSync( sync );
    mgr->setExportIdx( et );
    mgr->setMaxIncNum( inc_max_num );
    if ( mgr->open( path ) < 0 )
    {
        TERR("load inc index failed! path:%s", path);
        return -1;
    }

    TLOG("load inc index success!");

    return 0;
}
开发者ID:sdgdsffdsfff,项目名称:kingso,代码行数:38,代码来源:IndexLib.cpp

示例5: initProvCity

/**
 * 初始化  行政区划转换编码表
 *
 * @param path     数据存放路径  完整路径
 *
 * @return  0: success ;   -1: 程序处理失败
 */
int initProvCity(const char * path)
{
    ProvCityManager * mgr = ProvCityManager::getInstance();

    if ( NULL == mgr )
    {
        TERR("ProvCityManager instance is null");
        return -1;
    }

    if ( (NULL == path) || strlen( path ) <= 0 )
    {
        TERR("provcity node's path attribute is null");
        return -1;
    }

    TLOG("begin to load provcity! path:%s", path);

    if ( false == mgr->load( path ) )
    {
        TERR("load inc index failed! path:%s", path);
        return -1;
    }

    TLOG("load provcity success!");

    return 0;
}
开发者ID:sdgdsffdsfff,项目名称:kingso,代码行数:35,代码来源:IndexLib.cpp

示例6: initIdxBuilder

/**
 * 初始化 全量index 的 builder, 重新打开, 为了修改
 *
 * @param path     数据存放路径
 *
 * @return  0: success ;   -1: 程序处理失败
 */
int initIdxBuilder(const char * path)
{
    IndexBuilder * builder = IndexBuilder::getInstance();

    if ( NULL == builder )
    {
        TERR("IndexBuilder instance is null");
        return -1;
    }

    if ( (NULL == path) || strlen( path ) <= 0 )
    {
        TERR("index node's path attribute is null");
        return -1;
    }

    TLOG("begin to load full index! path:%s", path);

    if ( builder->reopen( path ) < 0)
    {
        TERR("load full index failed! path:%s", path);
        return -1;
    }

    TLOG("load full index success!");

    return 0;
}
开发者ID:sdgdsffdsfff,项目名称:kingso,代码行数:35,代码来源:IndexLib.cpp

示例7: ptr

QString toQSqlConnectionSub::version()
{
    QString ret;
    try
    {
        LockingPtr<QSqlDatabase> ptr(Connection, Lock);

        QSqlQuery query = ptr->exec(toSQL::sql("toQSqlConnection:Version", ParentConnection));
        if (query.next())
        {
            if (query.isValid())
            {
                QSqlRecord record = query.record();
                QVariant val = query.value(record.count() - 1);
                ret = val.toString().toLatin1();
            }
        }
    }
    catch (std::exception const&e)
    {
        TLOG(1, toDecorator, __HERE__) << "	Ignored exception:" << e.what() << std::endl;
        throw e;
    }
    catch (QString const&s)
    {
        TLOG(1, toDecorator, __HERE__) << "	Ignored exception:" << s << std::endl;
        throw s;
    }
    catch (...)
    {
        TLOG(1, toDecorator, __HERE__) << "	Ignored exception." << std::endl;
        throw;
    }
    return ret;
}
开发者ID:tora-tool,项目名称:tora,代码行数:35,代码来源:toqsqlconnection.cpp

示例8: TLOG

bool CPeer::ReadPacketForDOM( __in DWORD dwReceiveSize/* = 0*/ )
{
	INT iResult = 0;

	if( dwReceiveSize )
	{
		CNetwork::m_dwNumberOfBytesRecvd = dwReceiveSize;

		if( IntegratedLoadForRawData() == false )
		{
			TLOG( LOG_DEBUG, _T( "[ERROR] Failed to receive packet." ) );
			return false;
		}
	}

	// 수신 요청
	if( m_bIsSD_RECEIVE == false )
	{
		iResult = CNetwork::Receiving();
		if( iResult == NETWORK_IOC_STATE_FAILURE )
		{
			TLOG( LOG_DEBUG, _T( "[ERROR] Failed to request a receiving." ) );
			return false;
		}
	}

	return true;
}
开发者ID:fghj1,项目名称:POPTalk-Prototype,代码行数:28,代码来源:Peer.cpp

示例9: SCOPED_LOCK

bool CPeer::ReadPacketForWSAES( __out BYTE* pbyReceivedPacket/* = NULL*/ )
{
	INT iResult = 0;

	// 주의! 수신 데이터에 대한 1차 적재 처리와 2차 적재 처리에 비율
	//		 수신 데이터를 CNetwork::m_byReceiveBuffer에서 CPeer::m_byReceivedDataBuffer로 옮기는 것을
	//		 1차 적재라고 한다면 CPeer::m_byReceivedDataBuffer에서 수신용 Queue로 옮기는 것을 2차 적재라고 하자.
	//		 1차 적재 처리와 2차 적재 처리에 비율은 Packet을 수신하는 과정에서 Hang이 발생하는 것을 줄이는데 도움이 될 것 같다.
	//		 여기서 고려된 비율은 '1차 적재 처리 : 2차 적재 처리 = 2 : 3'이다.
	//		 즉, 1차 적재 처리가 2번 이뤄지면 2차 적재 처리는 3번 이뤄지도록 구현하여 1차 적재에 대비하여
	//		 CPeer::m_byReceivedDataBuffer가 항상 비워진 상태가 될 수 있도록 유도하는 것이다.
	if( pbyReceivedPacket )  // Packet별 Local 처리를 위해 수신 Packet 추출
	{
		ULONG_PTR ulOffset = -1;
		LPVOID lpPacketOwner = NULL;
		BYTE* pbyExtractedUnitPacket = NULL;
		DWORD dwPacketLength = 0;

		SCOPED_LOCK( m_CS )
		{
			if( m_ReadPD.GetFromQueue( &ulOffset, &lpPacketOwner, &pbyExtractedUnitPacket, &dwPacketLength ) == false )
				return false;

			// 추출 값 검사
			if( ulOffset == -1 ||
				lpPacketOwner == NULL ||
				pbyExtractedUnitPacket == NULL ||
				( dwPacketLength == 0 || PACKET_BUFFER_SIZE < dwPacketLength ) )
			{
				TLOG( LOG_DEBUG, _T( "[ERROR] Need to check. Failed to extract into the read packet queue." ) );
				TLOG( LOG_DEBUG,
					_T( "          ulOffset : %#p, lpPacketOwner : %#p, pbyExtractedUnitPacket : %#p, dwPacketLength : %lu" ),
					  ulOffset, lpPacketOwner, pbyExtractedUnitPacket, dwPacketLength );
				dwPacketLength = 0;
				if( 0 < ulOffset )
					m_ReadPD.RemoveFromMap( ulOffset );
				m_ReadPD.PopFromQueue();
				return false;
			}

			// 주의! pbyReceivedPacket에 크기를 알 수 없으므로 Buffer overflow가 발생할 가능성이 있다.
			// TODO: pbyReceivedPacket에 크기를 알 수 있도록 수정해야 한다.
			CopyMemory( pbyReceivedPacket, pbyExtractedUnitPacket, dwPacketLength );
			m_ReadPD.RemoveFromMap( ulOffset );
			m_ReadPD.PopFromQueue();
		}
	}
	else  // 수신 후, 수신용 Queue에 삽입
	{
		// 주의! FD_READ에 따라 CNetwork::Receiving()이 호출되기 전인
		//		 if( CNetwork::m_bWasPendingRecv ) Block 안에서 return하는 것은 신중해야 한다.
		// WSA_IO_PENDING에 대한 처리
		if( CNetwork::m_bWasPendingRecv )
开发者ID:fghj1,项目名称:POPTalk-Prototype,代码行数:53,代码来源:Peer.cpp

示例10: while

void toEditExtensions::autoIndentBuffer(void)
{
    if (Current)
    {
        QString text = Current->text();
        int pos = 0;
        while (pos < text.length() && text.at(pos).isSpace())
        {
            pos++;
        }
        Current->selectAll();
        try
        {
            try
            {
                Current->insert(toSQLParse::indent(text.mid(pos), toCurrentConnection(Current)));
            }
            catch (...)
            {
                TLOG(1, toDecorator, __HERE__) << "	Ignored exception." << std::endl;
                Current->insert(toSQLParse::indent(text.mid(pos)));
            }
        }
        TOCATCH;
    }
}
开发者ID:ShadowKyogre,项目名称:tora,代码行数:26,代码来源:toeditextensions.cpp

示例11: toCurrentConnection

void toEditExtensions::autoIndentBlock(void)
{
    if (Current)
    {
        try
        {
            int line1, col1, line2, col2;
            if (Current->getSelection(&line1, &col1, &line2, &col2))
            {
                QString t = Current->text(line1).mid(0, col1);
                t += QString::fromLatin1("a");
                int chars = 0;
                QString ind = toSQLParse::indentString(toSQLParse::countIndent(t, chars));
                QString mrk = Current->selectedText();
                QString res;
                try
                {
                    res = toSQLParse::indent(ind + mrk, toCurrentConnection(Current));
                }
                catch (...)
                {
                    TLOG(1, toDecorator, __HERE__) << "	Ignored exception." << std::endl;
                    res = toSQLParse::indent(ind + mrk);
                }
                t = Current->text(line2);
                unsigned int l = res.length() - ind.length();
                if (col2 == int(t.length()) && t.length() > 0) // Strip last newline if on last col of line
                    l--;
                res = res.mid(ind.length(), l); // Strip indent.
                Current->insert(res, true);
            }
        }
        TOCATCH;
    }
}
开发者ID:ShadowKyogre,项目名称:tora,代码行数:35,代码来源:toeditextensions.cpp

示例12: ptr

void toConnectionPool::fix(int member)
{
    if(!Connection)
        return;

    LockingPtr<SubList> ptr(Pool, PoolLock);
    PooledSub *psub = (*ptr)[member];
    psub->State = Broken;
    ptr.unlock();

    Connection->closeConnection(psub->Sub);
    PooledState state = Broken;
    toConnectionSub *sub = 0;
    try
    {
        sub = Connection->addConnection();
        state = Free;
    }
    catch(...)
    {
        TLOG(1, toDecorator, __HERE__) << "	Ignored exception." << std::endl;
        state = Broken;
    }

    ptr.lock();
    psub->State = state;
    psub->Sub = sub;
}
开发者ID:Daniel1892,项目名称:tora,代码行数:28,代码来源:toconnectionpool.cpp

示例13: QObject

toEventQuery::toEventQuery(QObject *parent
                           , QSharedPointer<toConnectionSubLoan> &conn
                           , QString const& sql
                           , toQueryParams const& param
                           , FETCH_MODE mode
                           , QList<QString> const &init
                           //, toResultStats *stats
                          )
    : QObject(parent)
    , SQL(sql)
    , Param(param)
    , ColumnCount(0)
    , Processed(0L)
    //, Statistics(stats)
    , Thread(NULL)
    , Worker(NULL)
    , Started(false)
    , WorkDone(false)
    , Connection(conn)
    , CancelCondition(new toEventQuery::WaitConditionWithMutex())
    , Mode(mode)
{
    /* BIG FAT WARNING QThread's parent must be  NULL, so it is not disposed when toEventQuery is deleted.
     * Theoretically (and practically) it can be freed after ~toEventQuery is processed
     */
    Thread = new BGThread(NULL);
    Thread->setObjectName("toEventQuery");
    TLOG(7, toDecorator, __HERE__) << "toEventQuery created" << std::endl;
}
开发者ID:Daniel1892,项目名称:tora,代码行数:29,代码来源:toeventquery.cpp

示例14: ClearSampleSet

// Split the node using best cut.
bool Node::Split(Node*& pLeftChild, Node*& pRightChild)
{
    SampleSet* pLeftSampleSet = NULL;
    SampleSet* pRightSampleSet = NULL;
    int nSampleCount = mpSampleSet->GetSampleCount();
    if(!mpSampleSet->Split(mpCut, pLeftSampleSet, pRightSampleSet))
    {
        return false;
    }
    ClearSampleSet();
    int nLeftSampleCount = pLeftSampleSet->GetSampleCount();
    int nRightSampleCount = pRightSampleSet->GetSampleCount();
    TLOG("split: (%d:%d) => [(%d:%d), (%d:%d)]", mnNodeId,
         nSampleCount, mnNodeId * 2 + 1, nLeftSampleCount, mnNodeId * 2 + 2,
         nRightSampleCount);
    pLeftChild = new Node(pLeftSampleSet, mpConf, mpLoss, mnNodeId * 2 + 1);
    pRightChild = new Node(pRightSampleSet, mpConf, mpLoss, mnNodeId * 2 + 2);
    pLeftChild->mpParent = this;
    pRightChild->mpParent = this;
    mpLeftChild = pLeftChild;
    mpRightChild = pRightChild;
    mpLeftChild->mSampleCount = nLeftSampleCount;
    mpRightChild->mSampleCount = nRightSampleCount;
    return true;
} // Split()
开发者ID:lastfallen,项目名称:mlplus,代码行数:26,代码来源:node.cpp

示例15: QDialog

toRollbackDialog::toRollbackDialog(toConnection &Connection, QWidget* parent, const char* name)
    : QDialog(parent)//, name, true)
{
    setupUi(this);

    toHelp::connectDialog(this);

    try
    {
        toConnectionSubLoan conn(Connection);
        toQuery q(conn, SQLTablespace, toQueryParams());
        while (!q.eof())
            Tablespace->addItem((QString)q.readValue());
    }
    catch (...)
    {
        TLOG(1, toDecorator, __HERE__) << "	Ignored exception." << std::endl;
    }
    connect(Tablespace, SIGNAL(textChanged(const QString &)),
            this, SLOT(valueChanged(const QString &)));

    Storage = new toStorageDefinition(DialogTabs);
    Storage->forRollback(true);
    DialogTabs->addTab(Storage, tr("Storage"));

    OkButton->setEnabled(false);
}
开发者ID:Daniel1892,项目名称:tora,代码行数:27,代码来源:torollback.cpp


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