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

C++ LOG_PRINT函数代码示例

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

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



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

示例1: LOG_PRINT

bool demo_http_server::run() {
  //here you can set worker threads count
  int thrds_count = 4;

  //go to loop
  LOG_PRINT("Run net_service loop( " << thrds_count << " threads)...",
            LOG_LEVEL_0);
  if (!m_net_server.run_server(thrds_count)) {
    LOG_ERROR("Failed to run net tcp server!");
  }

  LOG_PRINT("net_service loop stopped.", LOG_LEVEL_0);
  return true;
}
开发者ID:andyspb,项目名称:private,代码行数:14,代码来源:demo_http_server.cpp


示例2: register_lua_function

// type is 0 for energy, 1 for gradient
void register_lua_function(char *plugin_function_name, LUA_FUNCTION_TYPE type)
{
    LOG_PRINT(LOG_INFO,"Registering Lua function : %s \n",plugin_function_name);
    
    if(type == POTENTIAL)
        strcpy(lua_function[POTENTIAL],plugin_function_name);
    else if(type == GRADIENT)
        strcpy(lua_function[GRADIENT],plugin_function_name);
    else
    {
        LOG_PRINT(LOG_ERROR,"Unknown type %d for register_lua_function.\n",type);
        exit(-1);
    }
}
开发者ID:FHedin,项目名称:mc_LJ,代码行数:15,代码来源:plugins_lua.c


示例3: log_hexdump_line

void log_hexdump_line(struct log_handle *l) {
    if (!l)
        return;
    assert(l->prefix != NULL);
    assert(l->type == LOG_HEXDUMP);
    if (l->ctx.hexdump.nbytes == 0)
        return;
    LOG_PRINT("%s: %04x  ", l->prefix, l->ctx.hexdump.address);
    unsigned i;
    for (i = 0; i < l->ctx.hexdump.nbytes; i++) {
        int f = ((i + 1) == l->ctx.hexdump.flag) ? '*' : ' ';
        LOG_PRINT("%02x%c", l->ctx.hexdump.buf[i], f);
        if (i == 8)
            LOG_PRINT(" ");
    }
    for (; i < 16; i++) {
        LOG_PRINT("   ");
        if (i == 8)
            LOG_PRINT(" ");
    }
    LOG_PRINT(" |");
    for (i = 0; i < l->ctx.hexdump.nbytes; i++) {
        int c = l->ctx.hexdump.buf[i];
        LOG_PRINT("%c", isprint(c) ? c : (int)'.');
    }
    LOG_PRINT("|\n");
    l->ctx.hexdump.address += l->ctx.hexdump.nbytes;
    l->ctx.hexdump.nbytes = 0;
    l->ctx.hexdump.flag = -1;
}
开发者ID:jedie,项目名称:XRoar,代码行数:30,代码来源:logging.c


示例4: get_pkcs7_from_pem

static PKCS7*
get_pkcs7_from_pem(const char* enc_entity)
{
  const char* p;
  char*  wrapped_enc_entity = NULL;
  BIO*   rbio = NULL;
  PKCS7* p7 = NULL;
 
  /* Check if encrypted entity is composed of raw data or if it has some
   * headers. In the latter case, just skip the headers. Headers are
   * separated from data by an empty line (hence sequence CRLF CRLF).*/
  
  if (p = strstr(enc_entity, CRLF CRLF)) {
    enc_entity = p+4;
  } else if (p = strstr(enc_entity, LF LF)) {
    enc_entity = p+2;
  } else if (p = strstr(enc_entity, CR CR)) {
    enc_entity = p+2;
  }
  
  /* Make sure the pem markers are there */
  
  LOG_PRINT("get_pkcs7_from_pem: wrapping in pem markers");

  if (!(wrapped_enc_entity = wrap_in_pem_markers(enc_entity, "PKCS7")))
    GOTO_ERR("no memory?");
  LOG_PRINT("get_pkcs7_from_pem: wrapped.");
  
  /* Set up BIO so encrypted/signed data can be read from pem file */
  
  if (!(rbio = set_read_BIO_from_buf(wrapped_enc_entity, -1))) goto err;
  
  LOG_PRINT("get_pkcs7_from_pem: ready to read PKCS7 bio...");

  /* Load the PKCS7 object from a pem file to internal representation.
   * this reads all of the data file. */
  
  if (!(p7=PEM_read_bio_PKCS7(rbio,NULL/*&x*/,NULL/*callback*/,NULL/*arg*/)))
    GOTO_ERR("11 corrupt PEM PKCS7 file? (PEM_read_bio_PKCS7)");

  LOG_PRINT("get_pkcs7_from_pem: bio read");

  BIO_free_all(rbio);
  Free(wrapped_enc_entity);
  return p7;
err:
  if (rbio) BIO_free_all(rbio);
  if (wrapped_enc_entity) Free(wrapped_enc_entity);
  return NULL;
}
开发者ID:gitpan,项目名称:smime,代码行数:50,代码来源:smime-vfy.c


示例5: LOG_PRINT

void alarms_history::on_comboBoxLevel_currentIndexChanged(int index)
{
    LOG_PRINT(info_e, "_level %d\n", _level);
    /* 0 is all level */
    if (_level != index && index < nb_of_level_e)
    {
        _level = index;
        LOG_PRINT(info_e, "_level %d\n", _level);
        if (_file_nb == 0) return;
        if (loadLogFile(_current, _alarm, _event, _level) == false)
        {
            LOG_PRINT(error_e, "Cannot open log file %d\n", _current);
        }
    }
}
开发者ID:MECTsrl,项目名称:mect_apps,代码行数:15,代码来源:alarms_history.cpp


示例6: LOG_PRINT

    void Acceptor::listen()
    {
        socket_t fd = SocketOps::createSocket();

        if(fd < 0)
        {
            LOG_PRINT(LogType_Fatal, "create socket failed:%s %s:%d",
                      GetLastErrorText().c_str(), __FUNCTION__, __LINE__);
            return;
        }

        if(!SocketOps::bindSocket(fd, &listenAddr_.getSockAddr()))
        {
            LOG_PRINT(LogType_Fatal, "bind socket failed:%s %s:%d",
                      GetLastErrorText().c_str(), __FUNCTION__, __LINE__);
            goto err;
        }

        if(!SocketOps::listen(fd))
        {
            LOG_PRINT(LogType_Fatal, "listen socket failed:%s %s:%d",
                      GetLastErrorText().c_str(), __FUNCTION__, __LINE__);
            goto err;
        }

        if(!SocketOps::setSocketNoneBlocking(fd))
        {
            LOG_PRINT(LogType_Fatal, "enable socket noneBlocking failed:%s %s:%d",
                      GetLastErrorText().c_str(), __FUNCTION__, __LINE__);
            goto err;
        }

        LOG_PRINT(LogType_Info, "Acceptor listen at ip:%s port:%u", listenAddr_.ip().c_str(),
                  listenAddr_.port());

        listenFd_ = fd;
        acceptChannelPtr_ = std::make_shared<Channel>(loop_, listenFd_);
        acceptChannelPtr_->setReadCallback(std::bind(&Acceptor::handleRead, this));
        acceptChannelPtr_->setOwner(shared_from_this());
        acceptChannelPtr_->enableReading();
        listenning_ = true;

        return;

err:
        SocketOps::closeSocket(fd);
        return;
    }
开发者ID:pizishao,项目名称:project,代码行数:48,代码来源:Acceptor.cpp


示例7: timeGetTime

/*
*************************
Stops measuring the time
*************************
*/
void DebugApi::Stop ()
{
	unsigned long mElapsedTime = mTime - timeGetTime();
	if (mElapsedTime < 0) mElapsedTime = 0;
	mElapsedTime = mElapsedTime * (unsigned long) 0.001f;
	LOG_PRINT(" %d\n",  mElapsedTime);
}
开发者ID:CPPEngine,项目名称:CPPEngine,代码行数:12,代码来源:DebugApi.cpp


示例8: signal

/*
*************************
Writes a signal (for debugging purposes)
*************************
*/
void DebugApi::BreakPoint ()
{
	if (!mOk) return;

	LOG_PRINT("Abracadabra\n");
	
}
开发者ID:CPPEngine,项目名称:CPPEngine,代码行数:12,代码来源:DebugApi.cpp


示例9: switch

/**
 * make clone frame.
 * always make copy buffer on it.
 * @param prev_frame reuse frame object.
 * @param src_frame  source of clone.
 */
ttLibC_Video *ttLibC_Video_clone(
		ttLibC_Video *prev_frame,
		ttLibC_Video *src_frame) {
	if(src_frame == NULL) {
		return NULL;
	}
	switch(src_frame->inherit_super.type) {
//	case frameType_bgr:
	case frameType_flv1:
		return (ttLibC_Video *)ttLibC_Flv1_clone(
				(ttLibC_Flv1 *)prev_frame,
				(ttLibC_Flv1 *)src_frame);
	case frameType_h264:
		return (ttLibC_Video *)ttLibC_H264_clone(
 				(ttLibC_H264 *)prev_frame,
				(ttLibC_H264 *)src_frame);
//	case frameType_h265:
//	case frameType_theora:
//	case frameType_vp6:
//	case frameType_vp8:
//	case frameType_vp9:
//	case frameType_wmv1:
//	case frameType_wmv2:
//	case frameType_yuv420:
	default:
		LOG_PRINT("no clone function, frame type:%d", src_frame->inherit_super.type);
		return NULL;
	}
}
开发者ID:taktod,项目名称:ttLibC,代码行数:35,代码来源:video.c


示例10: mk_dirs

/**
 * @brief mk_dirs It creates a multi-level directory like ./img/330/28/557.
 *
 * @param dir The path of a multi-level directory.
 *
 * @return  1 for success and -1 for fail.
 */
int mk_dirs(const char *dir)
{
    char tmp[512];
    char *p;
    if (strlen(dir) == 0 || dir == NULL) 
    {
        LOG_PRINT(LOG_WARNING, "strlen(dir) is 0 or dir is NULL.");
        return -1;
    }
    memset(tmp, 0, sizeof(tmp));
    strncpy(tmp, dir, strlen(dir));
    if (tmp[0] == '/' && tmp[1]== '/') 
        p = strchr(tmp + 2, '/'); 
    else 
        p = strchr(tmp, '/');
    if (p) 
    {
        *p = '\0';
        mkdir(tmp,0777);
        chdir(tmp);
    } 
    else 
    {
        mkdir(tmp,0777);
        chdir(tmp);
        return 1;
    }
    mk_dirs(p + 1);
    return 1;
}
开发者ID:Chenxofhit,项目名称:zimg,代码行数:37,代码来源:zutil.c


示例11: is_dir

/**
 * @brief is_dir Check a path is a directory.
 *
 * @param path The path input.
 *
 * @return 1 for yes and -1 for no.
 */
int is_dir(const char *path)
{
    struct stat st;
    if(stat(path, &st)<0)
    {
        LOG_PRINT(LOG_WARNING, "Path[%s] is Not Existed!", path);
        return -1;
    }
    if(S_ISDIR(st.st_mode))
    {
        LOG_PRINT(LOG_INFO, "Path[%s] is A Dir.", path);
        return 1;
    }
    else
        return -1;
}
开发者ID:Chenxofhit,项目名称:zimg,代码行数:23,代码来源:zutil.c


示例12: rb_new

//buffern len is the number of pointers we want allocate, the ptr size is the maximum size of each ptr.
ring_t*
rb_new(uint32_t buffer_len)
{   
    ring_t * rb;
    rb = (ring_t*)malloc(sizeof(ring_t));
    if (!rb)
        return NULL;

    LOG_PRINT("\nRing buffer is being created with the size %d.", buffer_len);

    rb->size = buffer_len;

    rb->buffer_start = (uint8_t*)malloc(rb->size * sizeof *rb->buffer_start);
        memset(rb->buffer_start, 0, rb->size);
    
    rb->buffer_end =  (rb->buffer_start + (rb->size ) );
    rb->write_calls = 0;
    rb->read_calls = 0;
    rb->head = rb->buffer_start;
    rb->tail =  rb->buffer_end;
           
    rb->round_complete = 0;
    
    return rb;
}
开发者ID:kxp,项目名称:Continuous-RingBuffer,代码行数:26,代码来源:ring_buffer.c


示例13: if

void MainState::Update() {
	// Moves the player in the specified direction
	if (m_PlayerDirState[kPlayerDirLeft]) {
		m_Player->TranslateBy(Vec2(-5.0, 0.0));
	}
	else if (m_PlayerDirState[kPlayerDirRight]) {
		m_Player->TranslateBy(Vec2(5.0, 0.0));
	}
	else if (m_PlayerDirState[kPlayerDirUp]) {
		m_Player->TranslateBy(Vec2(0.0, -5.0));
	}
	else if (m_PlayerDirState[kPlayerDirDown]) {
		m_Player->TranslateBy(Vec2(0.0, 5.0));
	}

	for (int i = 0; i < m_ProjectileArray.GetSize(); ++i) {
		Rect screenRect = m_EnginePtr->GetScene()->GetScreenRect();

		Projectile* projectile = m_ProjectileArray[i];

		Vec2 pos = projectile->GetWorldPosition();

		if (pos.GetX() < screenRect.GetX() ||
			pos.GetX() > (screenRect.GetX() + screenRect.GetW()) ||
			pos.GetY() < screenRect.GetY() ||
			pos.GetY() > (screenRect.GetY() + screenRect.GetH())) {

			LOG_PRINT("removed");
		}
	}
}
开发者ID:colintan95,项目名称:raven,代码行数:31,代码来源:MainState.cpp


示例14: event_unregister_poll

static int
event_unregister_poll (struct event_pool *event_pool, int fd, int idx_hint)
{
        int idx = -1;

        GF_VALIDATE_OR_GOTO ("event", event_pool, out);

        pthread_mutex_lock (&event_pool->mutex);
        {
                idx = __event_getindex (event_pool, fd, idx_hint);

                if (idx == -1) {
                        LOG_PRINT(D_LOG_ERR,
                                "index not found for fd=%d (idx_hint=%d)",
                                fd, idx_hint);
                        errno = ENOENT;
                        goto unlock;
                }

                event_pool->reg[idx] =  event_pool->reg[--event_pool->used];
                event_pool->changed = 1;
        }
unlock:
        pthread_mutex_unlock (&event_pool->mutex);

out:
        return idx;
}
开发者ID:chenzhongtao,项目名称:mysource,代码行数:28,代码来源:event-poll.c


示例15: if

inline BaseEntity *EntityManager::GetBaseEntity( BaseEntityHandle& rBaseEntityHandle )
{
	BaseEntity *pBaseEntity = NULL;
	if( rBaseEntityHandle.GetBaseEntityPointer() )
	{
		// already loaded
		pBaseEntity = rBaseEntityHandle.GetBaseEntityPointer();
	}
	else if( rBaseEntityHandle.GetState() == BaseEntityHandle::STATE_INVALID )
	{
		// invalid base entity handle
		// - already tried to load the base entity before but it was not found in the database
		return NULL;
	}
	else // i.e. rBaseEntityHandle.GetState() == BaseEntityHandle::STATE_UNINITIALIZED
	{
		// get pointer to the base entity
		// if the base entity has not been loaded yet, load it
		if( LoadBaseEntity( rBaseEntityHandle ) )
		{
			pBaseEntity = rBaseEntityHandle.GetBaseEntityPointer();
		}
		else
		{
			LOG_PRINT( " - unable to create a copy entity (base entity: " + string(rBaseEntityHandle.GetBaseEntityName()) + ")" );
			return NULL;
		}
	}

	return pBaseEntity;
}
开发者ID:HermanHGF,项目名称:amorphous,代码行数:31,代码来源:EntitySet.cpp


示例16: RTC_XML_CFG_QosIpv4Cfg

GOS_ERROR_CODE RTC_XML_CFG_QosIpv4Cfg(BOOL bSrcApp)
{
    RG_QOS_IPV4_CFG_T msg;

    memset(&msg, 0, sizeof(msg));

    //Get Data from XML
    RTC_XML_GET_QosIpv4Cfg(&msg);

    LOG_PRINT(gRtcLogId1, LOG_LEVEL_NORMAL,
        "***QOS CFG*** "
        "enable:%d "
        "us_rate:%d "
        "count:%d ",
        msg.enable, msg.us_rate, msg.count
    );

    //Send sync Msg to NET
    RTC_SendSyncMsg("RG_MSG_CFG_QOS_IPV4_SET", PON_APPLID_NET, RG_MSG_CFG_QOS_IPV4_SET, &msg, sizeof(msg));

    if (SRCAPP_WEB == bSrcApp && RTC_IsTr069MgrReady())
    {
        //Send Msg to TR069
       VOS_SendMsg(PON_APPLID_TR069_MIB, RG_MSG_CFG_QOS_IPV4_SET, VOS_MSG_PRI_NORMAL, &msg, sizeof(msg));
    }

    return GOS_OK;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:28,代码来源:rtc_qos.c


示例17: snprintf

    void TcpServer::newConnection(int sockfd, const InetAddress& peerAddr)
    {
        loop_->assertInLoopThread();
        EventLoop* ioLoop = threadPool_->getNextLoop();
        char buf[64];
        snprintf(buf, sizeof buf, "-%s#%d", ipPort_.c_str(), nextConnId_);
        ++nextConnId_;
        std::string connName = name_ + buf;

        LOG_PRINT(LogType_Info, "TcpServer::newConnection [%s] - new connection [%s] from %s",
                  name_.c_str(), connName.c_str(), peerAddr.toIpPort().c_str());
        InetAddress localAddr(SocketOps::getLocalAddr(sockfd));
        // FIXME poll with zero timeout to double confirm the new connection
        // FIXME use make_shared if necessary
        TcpConnectionPtr conn(new TcpConnection(ioLoop,
                                                connName,
                                                sockfd,
                                                localAddr,
                                                peerAddr));
        connections_[connName] = conn;
        conn->setConnectionCallback(connectionCallback_);
        conn->setMessageCallback(messageCallback_);
        conn->setWriteCompleteCallback(writeCompleteCallback_);
        conn->setCloseCallback(
            std::bind(&TcpServer::removeConnection, this, std::placeholders::_1)); // FIXME: unsafe
        ioLoop->runInLoop(std::bind(&TcpConnection::connectEstablished, conn));
    }
开发者ID:pizishao,项目名称:project,代码行数:27,代码来源:TcpServer.cpp


示例18: assert

void ScheduleGraph::updateTask(TaskGraph::Node task, size_t delta) {
   vector<TaskGraph::Node> triggeredTasks;
   {
      // Update dependency
      int64_t previous=taskValues[task].fetch_add(delta);
      int64_t current=previous+delta;
      assert(current>=0);
      if(current==0) {
         LOG_PRINT("[ScheduleGraph] Finished task node "<<TaskGraph::getName(task));
         // Check if edge can be activated
         auto& nextTasks = targets[task];
         for (auto itr = nextTasks.begin(); itr != nextTasks.end(); ++itr) {
            const auto& nextTask = *itr;
            if(!triggered[nextTask].load()) {
               bool trigger=true;
               auto& dependencies=sources[nextTask];
               for (auto dependency = dependencies.begin(); dependency != dependencies.end(); ++dependency) {
                  if(taskValues[*dependency].load() != 0) {
                     trigger=false;
                  }
               }

               // Compare and exchange will only work for one task
               if(trigger && !triggered[nextTask].fetch_or(1)) {
                  triggeredTasks.push_back(nextTask);
               }
            }
         }
      }
   }

   for (auto task = triggeredTasks.begin(); task != triggeredTasks.end(); ++task) {
      runTask(*task);
   }
}
开发者ID:jinxuan,项目名称:SIGMOD-2014-Programming-Contest,代码行数:35,代码来源:schedulegraph.cpp


示例19: process_signal

static void process_signal(int sig){
	int r = 0;

	switch(sig) {
	case SIGINT:
	case SIGQUIT:
	case SIGTERM:
	case SIGHUP:
		r += log_status();
		break;
	case SIGUSR1:
	case SIGUSR2:
		log_debug();
		/*local_debug();*/
		cluster_debug();
		return;
	default:
		LOG_PRINT("Unknown signal received... ignoring");
		return;
	}

	if (!r) {
		LOG_DBG("No current cluster logs... safe to exit.");
		cleanup_all();
		exit(EXIT_SUCCESS);
	}

	LOG_ERROR("Cluster logs exist.  Refusing to exit.");
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:29,代码来源:clogd.c


示例20: zimg_type

static int zimg_type(lua_State *L)
{
    lua_arg *larg = pthread_getspecific(thread_key);
    lua_pushstring(L, larg->trans_type);
    LOG_PRINT(LOG_DEBUG, "zimg_type: %s", larg->trans_type);
    return 1;
}
开发者ID:734839030,项目名称:zimg,代码行数:7,代码来源:zlscale.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LOG_PROCESS_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ LOG_PRI函数代码示例发布时间: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