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


C++ LOG4CXX_DEBUG函数代码示例

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


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

示例1: readlink

const std::string Tools::douane_root_path(void) const
{
  char    result[PATH_MAX];
  readlink("/proc/self/exe", result, PATH_MAX);
  const char * root_dirname = dirname(result);
  std::string root_path = std::string(root_dirname);

  LOG4CXX_DEBUG(logger, "Douane root path is " << root_path);

  // Remove the /bin in case the root_path ends with it.
  std::string substr = "/bin";
  size_t position = root_path.rfind(substr);
  if ((position != std::string::npos) && (position == (root_path.length() - substr.length())))
  {
    return root_path.substr(0, position);
  } else {
    return root_path;
  }
}
开发者ID:pulser,项目名称:douane-dialog,代码行数:19,代码来源:tools.cpp

示例2: LOG4CXX_DEBUG

bool SnapshotControl::SaveBloomFilter(BloomFilter<Checksum>* pbf, const string& bf_name)
{
    if (!FileSystemHelper::GetInstance()->IsDirectoryExists(vm_path_))
        FileSystemHelper::GetInstance()->CreateDirectory(vm_path_);
    if (FileSystemHelper::GetInstance()->IsFileExists(bf_name))
        FileSystemHelper::GetInstance()->RemoveFile(bf_name);

	FileHelper* fh = FileSystemHelper::GetInstance()->CreateFileHelper(bf_name, O_WRONLY);
	fh->Create();

	stringstream buffer;
	pbf->Serialize(buffer);
	LOG4CXX_DEBUG(logger_, "Bloom filter primary size " << buffer.str().size());
    fh->Write((char *)buffer.str().c_str(), buffer.str().size());

    fh->Close();
    FileSystemHelper::GetInstance()->DestroyFileHelper(fh);
    return true;
}
开发者ID:ChenHuge,项目名称:bigarchive,代码行数:19,代码来源:snapshot_control.cpp

示例3: LOG4CXX_DEBUG

const ArrayDesc& LogicalQueryPlanNode::inferTypes(std::shared_ptr< Query> query)
{
    std::vector<ArrayDesc> inputSchemas;
    ArrayDesc outputSchema;
    for (size_t i=0, end=_childNodes.size(); i<end; i++)
    {
        inputSchemas.push_back(_childNodes[i]->inferTypes(query));
    }
    outputSchema = _logicalOperator->inferSchema(inputSchemas, query);
    //FIXME: May be cover inferSchema method with another one and assign alias there?
    if (!_logicalOperator->getAliasName().empty())
    {
        outputSchema.addAlias(_logicalOperator->getAliasName());
    }
    _logicalOperator->setSchema(outputSchema);
    LOG4CXX_DEBUG(logger, "Inferred schema for operator " <<
                  _logicalOperator->getLogicalName() << ": " << outputSchema);
    return _logicalOperator->getSchema();
}
开发者ID:cerbo,项目名称:scidb,代码行数:19,代码来源:QueryPlan.cpp

示例4: LOG4CXX_ERROR

void GameMaster::run()
{
    if(eh_->dh_->dhInitMysql() == false){
        LOG4CXX_ERROR(logger_,"system;Data handler failed to connect to db,exit!");
        exit(1);
    }
    
    eh_->dh_->loadTrialRank();
    eh_->dh_->loadPvpRankUids();

    vector<EventCmd> event_cmds;

    for(;;){
        long long now = time(NULL);
        eh_->now_time_ = now;

        if(eh_->dh_->db_error_ != 0){
            eh_->dh_->closeDbConnection();
            LOG4CXX_ERROR(logger_,"system;Data handler close connection to db!");
        }
        if(eh_->dh_->dbc_open_ == false){
            if(now - db_reconnect_time_ >= 60){
                if(eh_->dh_->dhInitMysql() == false){
                    LOG4CXX_ERROR(logger_,"system;Data handler failed to reconnect to db!");
                    db_reconnect_time_ = now;
                }
            }
        }
        event_cmds.clear();
        eq_->acquireLock();
        while(!(eq_->getEventQueue().empty())){
            event_cmds.push_back(eq_->getEventQueue().front());
            eq_->getEventQueue().pop();
        }
        eq_->releaseLock();
        for(size_t i=0;i<event_cmds.size();i++){
            LOG4CXX_DEBUG(logger_, "received;"<<event_cmds[i].cmd_);
            //nh_->sendString(event_cmds[i].fd_,event_cmds[i].cmd_);
            eh_->handle(event_cmds[i]);
        }
    }
}
开发者ID:hapigames,项目名称:he,代码行数:42,代码来源:GameMaster.cpp

示例5: LOG4CXX_DEBUG

void WSCoreBoundQueuesScheduler::pushToQueue(std::shared_ptr<Task> task) {
    int core = task->getPreferredCore();
    if (core >= 0 && core < static_cast<int>(this->_queues)) {
      // push task to queue that runs on given core
      this->_taskQueues[core]->push(task);
      LOG4CXX_DEBUG(this->_logger,  "Task " << std::hex << (void *)task.get() << std::dec << " pushed to queue " << core);
    } else if (core == Task::NO_PREFERRED_CORE || core >= static_cast<int>(this->_queues)) {
      if (core < Task::NO_PREFERRED_CORE || core >= static_cast<int>(this->_queues))
        // Tried to assign task to core which is not assigned to scheduler; assigned to other core, log warning
        LOG4CXX_WARN(this->_logger, "Tried to assign task " << std::hex << (void *)task.get() << std::dec << " to core " << std::to_string(core) << " which is not assigned to scheduler; assigned it to next available core");
      // push task to next queue
      {
        std::lock_guard<lock_t> lk2(this->_queuesMutex);
        this->_taskQueues[this->_nextQueue]->push(task);
        //std::cout << "Task " <<  task->vname() << "; hex " << std::hex << &task << std::dec << " pushed to queue " << this->_nextQueue << std::endl;
        //round robin on cores
        this->_nextQueue = (this->_nextQueue + 1) % this->_queues;
      }
    }
  }
开发者ID:JWUST,项目名称:hyrise,代码行数:20,代码来源:WSCoreBoundQueuesScheduler.cpp

示例6: IntToString

void Iax2Sessions::Hoover(time_t now)
{
	CStdString numSessions;
	int timeoutSeconds = 0;
	Iax2SessionRef session;
	std::map<CStdString, Iax2SessionRef>::iterator pair;
	std::list<Iax2SessionRef> toDismiss;
	std::list<Iax2SessionRef>::iterator it;

	numSessions = IntToString(m_bySrcIpAndCallNo.size());
	LOG4CXX_DEBUG(m_log, "Hoover - check " + numSessions + " sessions time:" + IntToString(now));
	timeoutSeconds = DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec;

	for(pair=m_bySrcIpAndCallNo.begin(); pair!=m_bySrcIpAndCallNo.end(); pair++) {
		session = pair->second;

		if((now - session->m_lastUpdated) > timeoutSeconds)
			toDismiss.push_back(session);
	}

	for (it=toDismiss.begin(); it!=toDismiss.end(); it++) {
		session = *it;
		LOG4CXX_INFO(m_log,  "[" + session->m_trackingId + "] " + session->m_srcIpAndCallNo + " Expired");
		Stop(session);
	}

	/* Just in case? */
	toDismiss.clear();
	for(pair=m_byDestIpAndCallNo.begin(); pair!=m_byDestIpAndCallNo.end(); pair++) {
		session = pair->second;

		if((now - session->m_lastUpdated) > timeoutSeconds)
			toDismiss.push_back(session);
	}

	for (it=toDismiss.begin(); it!=toDismiss.end(); it++) {
                session = *it;
                LOG4CXX_INFO(m_log,  "[" + session->m_trackingId + "] " + session->m_destIpAndCallNo + " Expired");
                Stop(session);
        }
}
开发者ID:HiPiH,项目名称:Oreka,代码行数:41,代码来源:Iax2Session.cpp

示例7: LOG4CXX_DEBUG

bool retreiver::getdevices(RETREIVER_DATA *msg) {
	// db's connect is a blocking call so false means no more data
	// not a failure to connect, unless access/pswd is incorrect
	if(m_devices_db.get_devices() == false) // open db and get next record
		return false;

	if(m_devices_db.m_deviceid < 1) // invalid so skipping
		return true;

	if(checkhostname() == true) {
		msg->ip = m_devices_db.m_deviceip;
		msg->dnsname = m_devices_db.m_dnsname;
		msg->hostname = m_devices_db.m_hostname;

		msg->deviceid = m_devices_db.m_deviceid;
		LOG4CXX_DEBUG("got device record from db for " << msg->dnsname);
	} else {
		LOG4CXX_INFO("NOT PING-ABLE " << m_devices_db.m_dnsname);
	}
	return true;
}
开发者ID:robacklin,项目名称:harmonics,代码行数:21,代码来源:retreiver.cpp

示例8: LOG4CXX_DEBUG

void ParticleContainerLC::emptyHaloSide(int fixedDim, int fixedVal) {
	int idx[DIM];
	idx[fixedDim] = fixedVal;
#if 1<DIM
	const int nextDim = (fixedDim+1) % DIM;
#endif
#if 3==DIM
	const int lastDim = (fixedDim+2) % DIM;
#endif
	// iterate over wall cells
#if 1<DIM
	for (idx[nextDim] = 0; idx[nextDim] < allCellNums[nextDim]; idx[nextDim]++)
#endif
#if 3==DIM
		for (idx[lastDim] = 0; idx[lastDim] < allCellNums[lastDim]; idx[lastDim]++)
#endif
		{
			allCells[calcIndex(idx, allCellNums)]->root = NULL;
		}
	LOG4CXX_DEBUG(particlelog, "end empty halo");
}
开发者ID:Gruppe3,项目名称:MolSimGR3,代码行数:21,代码来源:ParticleContainerLC.cpp

示例9: resource

shared_ptr<IBDeviceResource> IBDeviceResourceManager::getResource(ibv_context* context)
{
	// TODO check if std::map allow concurrent read access
	tResourceMap::iterator it = mResourceMap.find(context);

	if(it == mResourceMap.end())
	{
		shared_ptr<IBDeviceResource> resource(new IBDeviceResource(context));

		if(mGlobalMemoryRegion.address != NULL && mGlobalMemoryRegion.size > 0)
			resource->regGlobalMemoryRegion(mGlobalMemoryRegion.address, mGlobalMemoryRegion.size);

		mResourceMap[context] = resource;

		LOG4CXX_DEBUG(mLogger, "creating IBDeviceResource which has ibv_context pointer = " << context);

		return resource;
	}

	return it->second;
}
开发者ID:zillians,项目名称:supercell_common,代码行数:21,代码来源:IBDeviceResourceManager.cpp

示例10: LOG4CXX_WARN

bool SnapshotControl::SaveSnapshotMeta()
{
    if (!FileSystemHelper::GetInstance()->IsDirectoryExists(vm_path_))
        FileSystemHelper::GetInstance()->CreateDirectory(vm_path_);
    if (FileSystemHelper::GetInstance()->IsFileExists(ss_meta_pathname_)) {
        LOG4CXX_WARN(logger_, "Sanpshot metadata exists, will re-create " << ss_meta_pathname_);
        FileSystemHelper::GetInstance()->RemoveFile(ss_meta_pathname_);
    }
	FileHelper* fh = FileSystemHelper::GetInstance()->CreateFileHelper(ss_meta_pathname_, O_WRONLY);
	fh->Create();

	stringstream buffer;
	ss_meta_.Serialize(buffer);
    ss_meta_.SerializeRecipe(buffer);
	LOG4CXX_DEBUG(logger_, "save snapshot meta, size is" << buffer.str().size());
    fh->Write((char *)buffer.str().c_str(), buffer.str().size());

    fh->Close();
    FileSystemHelper::GetInstance()->DestroyFileHelper(fh);
    return true;
}
开发者ID:ChenHuge,项目名称:bigarchive,代码行数:21,代码来源:snapshot_control.cpp

示例11: image

shared_ptr<SDL_Surface> SDL::generate(const string & filename, bool alpha) {
    shared_ptr<SDL_Surface> image(IMG_Load(filename.c_str()), &freeSurface);

    if (image == NULL)
        throw SDLException(IMG_GetError(), HERE);

    shared_ptr<SDL_Surface> optimizedImage(optimize(image, alpha));

    if (optimizedImage == NULL)
        throw SDLException(IMG_GetError(), HERE);

    Uint32 flags = SDL_RLEACCEL;
    if (alpha)
        flags |= SDL_SRCALPHA;

    SDL_SetAlpha(optimizedImage.get(), flags, SDL_ALPHA_OPAQUE); // doubles the fps :o

    LOG4CXX_DEBUG(m_logger, "Image at " << filename << " loaded successfully. Alpha blending is " << (alpha ? "enabled." : "disabled."));

    return optimizedImage;
}
开发者ID:bossie,项目名称:Assteroids,代码行数:21,代码来源:SDL.cpp

示例12: LOG4CXX_TRACE

bool FileCertManager::isCertKnown(std::string dn, std::string fingerprint)
{
	LOG4CXX_TRACE(logger, "isCertKnown()");
	LOG4CXX_DEBUG(logger, "dn = " << dn);
	LOG4CXX_DEBUG(logger, "fp = " << fingerprint);

	const map<string,string>::iterator it = certMap.find(dn);
	if (it == certMap.end()) {
		LOG4CXX_DEBUG(logger, "DN not registered");
	} else {
		LOG4CXX_DEBUG(logger, "Comparing fingerprints...");
		LOG4CXX_DEBUG(logger, "fingerprint [file]  = " << (*it).second);
		LOG4CXX_DEBUG(logger, "fingerprint [asked] = " << fingerprint);

		if (!(*it).second.compare(fingerprint)) {
			LOG4CXX_DEBUG(logger, "Good fingerprint for this dn :-)");
			return true;
		} else {
			LOG4CXX_DEBUG(logger, "Wrong fingerprint for this dn :-(");
		}
	}
	return false;
}
开发者ID:ak49007,项目名称:tnc-fhh,代码行数:23,代码来源:FileCertManager.cpp

示例13: logger

// ============================================================
// Function : throwError()
// ------------------------------------------------------------
// 
// ============================================================
void errorHandler::throwError(error e)
{
    this->messages.push_back(e);
    if (this->maxMessages != 0 && (this->messages.size() > this->maxMessages)) {
      this->messages.pop_front();
    }

    if (this->log && (e.getType() <= this->level)) {
#ifdef USE_LOG4CXX
      // Get logger object
      log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(LOGGER_NAME));

      std::stringstream ss;
      ss << e;
      switch(e.getType()) {
        case 0:
          LOG4CXX_INFO(logger, ss.str());
          break;
        case 1:
          LOG4CXX_INFO(logger, ss.str());
          break;
        case 2:
          LOG4CXX_WARN(logger, ss.str());
          break;
        case 3:
          LOG4CXX_DEBUG(logger, ss.str());
          break;
        case 4:
          LOG4CXX_ERROR(logger, ss.str());
          break;
        default:
          LOG4CXX_INFO(logger, ss.str());
          break;
      }
#else
      *stream << e;
      stream->flush();
#endif
    }
}
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:45,代码来源:errorHandler.cpp

示例14: LOG4CXX_INFO

long MessageHandler::insertAudio(long translationid, const MessageAudio &ma)
{
    LOG4CXX_INFO(narratorMsgHlrLog, "Inserting new messageaudio for translation with id: " << translationid);
    LOG4CXX_DEBUG(narratorMsgHlrLog, "tagid: " << ma.getTagid() << ", uri: " << ma.getUri() << ", md5: " << ma.getMd5() << ", size: " << ma.getSize() << ", length: " << ma.getLength() << ", encoding: " << ma.getEncoding());

    int audioid = -1;

    if(ma.isAudioDataNil()) {
        LOG4CXX_ERROR(narratorMsgHlrLog, "No audio data has been set");
        return -1;
    }

    if(!db->prepare("INSERT INTO messageaudio (translation_id, tagid, text, length, encoding, data, size, md5) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")) {
        LOG4CXX_ERROR(narratorMsgHlrLog, "Query failed '" << db->getLasterror() << "'");
        return -1;
    }

    if(!db->bind(1, translationid) ||
            !db->bind(2, ma.getTagid()) ||
            !db->bind(3, ma.getText().c_str()) ||
            !db->bind(4, ma.getLength()) ||
            !db->bind(5, ma.getEncoding().c_str()) ||
            !db->bind(6, ma.getAudioData(), ma.getSize()) ||
            !db->bind(7, (long)ma.getSize()) ||
            !db->bind(8, ma.getMd5(), 32, NULL)) {
        LOG4CXX_ERROR(narratorMsgHlrLog, "Bind failed '" << db->getLasterror() << "'");
        return -1;
    }

    narrator::DBResult result;
    if(!db->perform(&result)) {
        LOG4CXX_ERROR(narratorMsgHlrLog, "Query failed '" << db->getLasterror() << "'");
        return -1;
    }

    audioid = result.getInsertId();

    return audioid;
}
开发者ID:SparseMind,项目名称:libkolibre-narrator,代码行数:39,代码来源:MessageHandler.cpp

示例15: assert

void MPIPhysical::postSingleExecute(shared_ptr<Query> query)
{
    // On a non-participating launcher instance it is difficult
    // to determine when the launch is complete without a sync point.
    // postSingleExecute() is run after all instances report success of their execute() phase,
    // that is effectively a sync point.
    assert(query->getCoordinatorID() == COORDINATOR_INSTANCE);
    assert(_mustLaunch);
    assert(_ctx);
    const uint64_t lastIdInUse = _ctx->getLastLaunchIdInUse();

    boost::shared_ptr<MpiLauncher> launcher(_ctx->getLauncher(lastIdInUse));
    assert(launcher);
    if (launcher && launcher == _launcher) {
        LOG4CXX_DEBUG(logger, "MPIPhysical::postSingleExecute: destroying last launcher for launch = " << lastIdInUse);
        assert(lastIdInUse == _launchId);

        launcher->destroy();
        _launcher.reset();
    }
    _ctx.reset();
}
开发者ID:Myasuka,项目名称:scidb,代码行数:22,代码来源:MPIPhysical.cpp


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