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

C++ LOGMSG函数代码示例

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

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



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

示例1: arch_bfdInit

static bool arch_bfdInit(pid_t pid, bfd_t * bfdParams)
{
    char fname[PATH_MAX];
    snprintf(fname, sizeof(fname), "/proc/%d/exe", pid);
    if ((bfdParams->bfdh = bfd_openr(fname, 0)) == NULL) {
        LOGMSG(l_ERROR, "bfd_openr(%s) failed", fname);
        return false;
    }

    if (!bfd_check_format(bfdParams->bfdh, bfd_object)) {
        LOGMSG(l_ERROR, "bfd_check_format() failed");
        return false;
    }

    int storage_needed = bfd_get_symtab_upper_bound(bfdParams->bfdh);
    if (storage_needed <= 0) {
        LOGMSG(l_ERROR, "bfd_get_symtab_upper_bound() returned '%d'", storage_needed);
        return false;
    }

    if ((bfdParams->syms = (asymbol **) malloc(storage_needed)) == NULL) {
        LOGMSG_P(l_ERROR, "malloc(%d) failed", storage_needed);
        return false;
    }
    bfd_canonicalize_symtab(bfdParams->bfdh, bfdParams->syms);

    if ((bfdParams->section = bfd_get_section_by_name(bfdParams->bfdh, ".text")) == NULL) {
        LOGMSG(l_ERROR, "bfd_get_section_by_name('.text') failed");
        return false;
    }

    return true;
}
开发者ID:LucaBongiorni,项目名称:honggfuzz,代码行数:33,代码来源:bfd.c


示例2: arch_prepareParent

bool arch_prepareParent(honggfuzz_t * hfuzz)
{
    if (!hfuzz->pid) {
        return true;
    }
#define MAX_THREAD_IN_TASK 4096
    int tasks[MAX_THREAD_IN_TASK + 1];
    tasks[MAX_THREAD_IN_TASK] = 0;
    if (!arch_listThreads(tasks, MAX_THREAD_IN_TASK, hfuzz->pid)) {
        LOGMSG(l_ERROR, "Couldn't read thread list for pid '%d'", hfuzz->pid);
        return false;
    }

    for (int i = 0; i < MAX_THREAD_IN_TASK && tasks[i]; i++) {
        if (ptrace(PT_ATTACH, tasks[i], NULL, NULL) == -1) {
            LOGMSG_P(l_ERROR, "Couldn't ptrace() ATTACH to pid: %d", tasks[i]);
            return false;
        }

        int status;
        while (waitpid(tasks[i], &status, WUNTRACED | __WALL) != tasks[i]) ;

        if (ptrace(PT_CONTINUE, tasks[i], NULL, NULL) == -1) {
            LOGMSG_P(l_ERROR, "Couldn't ptrace() CONTINUE pid: %d", tasks[i]);
            ptrace(PT_DETACH, tasks[i], 0, SIGCONT);
            return false;
        }

        LOGMSG(l_INFO, "Successfully attached to pid/tid: %d", tasks[i]);
    }
    return true;
}
开发者ID:Berrrry,项目名称:honggfuzz-android,代码行数:32,代码来源:arch_ptrace.c


示例3: InterpretException

    // interpret exception processed by Utils::HandleException:
    // filter out some errors like invalid db - users don't want to
    // see such errors as actual errors
    int InterpretException ( int64_t rcCodeUtil, bool bSilent, char const* szErrDesc )
    {
        if ( rcCodeUtil == Utils::rcUnknown ||
             rcCodeUtil == Utils::rcErrorStdExc ||
             rcCodeUtil == Utils::rcInvalid)
        {
            if ( ! bSilent )
                LOGMSG ( klogErr, szErrDesc );

            return 3;
        }
        else if (rcCodeUtil == SILENT_RC( rcDB,rcMgr,rcOpening,rcDatabase,rcIncorrect ) ||
            rcCodeUtil == SILENT_RC( rcVFS,rcTree,rcResolving,rcPath,rcNotFound ))
        {
            if ( ! bSilent )
                LOGMSG ( klogWarn, szErrDesc );
            return 0;
        }
        else
        {
            if ( ! bSilent )
                LOGMSG ( klogErr, szErrDesc );
            return 3;
        }
    }
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:28,代码来源:align-cache.cpp


示例4: LOGMSG

int cRawWriter::Put(eStreamId StreamId, uint64_t StreamPos,
                    const uchar *Data, int DataCount)
{
  if (Running() && StreamId == sidVdr) {

    // Serialize Put access to keep Data and Header together
    LOCK_THREAD;

    if (m_RingBuffer.Free() < DataCount) {
      if (m_BufferOverflows++ > MAX_OVERFLOWS_BEFORE_DISCONNECT) {
        LOGMSG("cXinelibServer: Too many TCP buffer overflows, dropping client");
        m_RingBuffer.Clear();
        Cancel(-1);
        return 0;
      }
      return -DataCount;
    }
    int n = m_RingBuffer.Put(Data, DataCount);
    if (n == DataCount) {
      m_BufferOverflows = 0;
      m_PutPos += n;
      return n;
    }

    LOGMSG("cXinelibServer: TCP buffer internal error ?!?");
    m_RingBuffer.Clear();
    Cancel(-1);
  }

  return 0;
}
开发者ID:flensrocker,项目名称:vdr-plugin-xineliboutput,代码行数:31,代码来源:backgroundwriter.c


示例5: arch_ptraceEvent

static void arch_ptraceEvent(honggfuzz_t * hfuzz, fuzzer_t * fuzzer, int status, pid_t pid)
{
    unsigned long event_msg;
    if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, &event_msg) == -1) {
        LOGMSG(l_ERROR, "ptrace(PTRACE_GETEVENTMSG,%d) failed", pid);
        return;
    }

    LOGMSG(l_DEBUG, "PID: %d, Ptrace event: %d, event_msg: %ld", pid, __WEVENT(status), event_msg);
    switch (__WEVENT(status)) {
    case PTRACE_EVENT_EXIT:
        if (WIFEXITED(event_msg)) {
            LOGMSG(l_DEBUG, "PID: %d exited with exit_code: %d", pid, WEXITSTATUS(event_msg));
            if (WEXITSTATUS(event_msg) == HF_MSAN_EXIT_CODE) {
                arch_ptraceSaveData(hfuzz, pid, fuzzer);
            }
        } else if (WIFSIGNALED(event_msg)) {
            LOGMSG(l_DEBUG, "PID: %d terminated with signal: %d", pid, WTERMSIG(event_msg));
        } else {
            LOGMSG(l_DEBUG, "PID: %d exited with unknown status: %ld", pid, event_msg);
        }
        break;
    default:
        break;
    }

    ptrace(PT_CONTINUE, pid, 0, 0);
    return;
}
开发者ID:rtzoeller,项目名称:honggfuzz,代码行数:29,代码来源:ptrace_utils.c


示例6: _remove_phone

static void _remove_phone(const char* phoneno)
{
    phone_entry_t* entry;
    phone_entry_t* prev = NULL;

    //TODO: mutex protection of calling function
    entry = G_phoneBook.head;
    while(entry && strcmp(entry->phoneNo, phoneno)) {
        prev = entry;
        entry = entry->next;
    }
    if (entry == NULL) {
        LOGMSG(LOG_LEVEL_WARN, "Could not found registered phone no %s. Has been removed or un-registered ?\n", phoneno);
        return;
    }
    if (prev == NULL) {
        G_phoneBook.head = entry->next;
    } else {
        prev->next = entry->next;
    }
    //Delete this number
    delete_phone_entry(&entry);
    G_phoneBook.size--;
    LOGMSG(LOG_LEVEL_INFO, "Remove phone no %s success.\n", phoneno);
}
开发者ID:quancao,项目名称:zzz-vitron-01,代码行数:25,代码来源:database.c


示例7: parse_phonebook

static gn_error parse_phonebook(char *text)
{
    cJSON *root;
	
	root = cJSON_Parse(text);
	if (!root) {
        LOGMSG(LOG_LEVEL_CRIT, "Error before: [%s]\n",cJSON_GetErrorPtr());
        return GN_ERR_FAILED;
    }
    cJSON* phonebook = cJSON_GetObjectItem(root,"phonebook");
    if (!phonebook) {
        LOGMSG(LOG_LEVEL_CRIT, "Error: could not read phonebook object\n");
        return GN_ERR_FAILED;
    }
    int i; 
    for (i = 0;i < cJSON_GetArraySize(phonebook);i++)
    {
        cJSON *phoneItem = cJSON_GetArrayItem(phonebook,i);
        // handle subitem.	
        LOGMSG(LOG_LEVEL_DEBUG, "item #%d: name=%s phone=%s\n",i, 
                cJSON_GetObjectItem(phoneItem, "name")->valuestring,
                cJSON_GetObjectItem(phoneItem, "phone")->valuestring);
        _add_phone(cJSON_GetObjectItem(phoneItem, "name")->valuestring,
                cJSON_GetObjectItem(phoneItem, "phone")->valuestring);
    }
    cJSON_Delete(root);
    return GN_ERR_NONE;
}
开发者ID:quancao,项目名称:zzz-vitron-01,代码行数:28,代码来源:database.c


示例8: BufferQPopBuffer

rc_t BufferQPopBuffer (BufferQ * self, const Buffer ** buff, timeout_t * tm)
{
    rc_t rc = 0;
    timeout_t t;
    void * p;
    LOGMSG (klogDebug10, "BufferQPopBuffer");
    assert (self != NULL);
    assert (buff != NULL);

    if (tm == NULL)
    {
	LOGMSG (klogDebug10, "BufferQPopBuffer tm was NULL");
	tm = &t;
	rc = TimeoutInit (tm, self->timeout);
    }

    if (rc == 0)
    {
	LOGMSG (klogDebug10, "BufferQPopBuffer call KQueuePop");
	rc = KQueuePop (self->q, &p, tm);
	PLOGMSG (klogDebug10, "BufferQPopBuffer back from KQueuePop $(rc)", PLOG_U32(rc), rc);
	if (rc == 0)
	    *buff = p;
	else
	{
	    *buff = NULL;
	}
    }
    LOGMSG (klogDebug10, "leave BufferQPopBuffer");
    return rc;
}
开发者ID:Bhumi28,项目名称:sra-tools,代码行数:31,代码来源:ccbufferq.c


示例9: LOGMSG

LRESULT CWindowCredentials::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if ( (false == iSplashLaunched) && (::GetFocus() == m_hWnd) )
	{
		LOGMSG("launching splash!!!");
		WindowsManager::GetInstnace()->ShowWindow( EWndSplash );
		::SetFocus( WindowsManager::GetInstnace()->GetWindow( EWndSplash )->m_hWnd );
		
		LOGMSG("Launched...");
		iSplashLaunched = true;
	}

	if ( TRUE == this->IsWindowVisible() )
	{
		bHandled = FALSE;
	}



	//SHMENUBARINFO mbi;
	//ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
	//mbi.cbSize = sizeof(SHMENUBARINFO);
	//mbi.hwndParent = m_hWnd;
	//mbi.nToolBarId = 201;
	//mbi.hInstRes = ModuleHelper::GetResourceInstance();
	//mbi.dwFlags = SHCMBF_HMENU;

	//SHCreateMenuBar( &mbi );

	//bHandled = TRUE;

	

	return 0;
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:35,代码来源:windowcredentials.cpp


示例10: announce4

struct bt_announce4_reply* announce4(struct bt_announce4_request *request) {
	
	#if 0
	/* TODO: check if connection_id is known */

	/* replace 0 (default) ip with the real ip address */
	if(ip==0) {
		ip = cliAddr.sin_addr.s_addr;		
	}
	
	/* convert info_hash and peer_id to hex so that they are printable */
	info_hash_hex = strToHexStr(info_hash,20);
	peer_id_hex = strToHexStr(peer_id,20);

	LOGMSG(LOG_DEBUG,"Connection ID: %lld",connection_id);
	LOGMSG(LOG_DEBUG,"Info Hash: %s Peer ID: %s",info_hash_hex, peer_id_hex);
	LOGMSG(LOG_DEBUG,"Downloaded: %lld Left: %lld Uploaded: %lld",downloaded,left,uploaded);
	LOGMSG(LOG_DEBUG,"Event: %uNumber of Peers wanted: %u",event, num_want);

	/* TODO: if authentication extension is activated check if auth correct */
	
	/* check if peer has already announced */
	int announced = has_peer_announced_in_past(info_hash_hex,peer_id_hex);
        /* update entry if peer has announced already */
	update_database4(info_hash_hex,peer_id_hex,downloaded,uploaded,left,ip,key,port,announced);
	/* delet old peers from database */
	delete_old_entries(interval);
        /* Get number of seeders and leechers */
	seeders_and_leechers(info_hash_hex,&seeders,&leechers);
	/* get data of the peers from the database */
	Peer *peers;
	peers = get_peer_data4(&num_peers,info_hash_hex,num_want);
	#endif
	return NULL;
}
开发者ID:n0g,项目名称:racker,代码行数:35,代码来源:actions.c


示例11: arch_ptraceAttach

bool arch_ptraceAttach(pid_t pid)
{
#define MAX_THREAD_IN_TASK 4096
    int tasks[MAX_THREAD_IN_TASK + 1];
    tasks[MAX_THREAD_IN_TASK] = 0;
    if (!arch_listThreads(tasks, MAX_THREAD_IN_TASK, pid)) {
        LOGMSG(l_ERROR, "Couldn't read thread list for pid '%d'", pid);
        return false;
    }

    for (int i = 0; i < MAX_THREAD_IN_TASK && tasks[i]; i++) {
        if (ptrace
            (PTRACE_SEIZE, tasks[i], NULL,
             PTRACE_O_TRACECLONE | PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXIT) ==
            -1) {
            LOGMSG_P(l_ERROR, "Couldn't ptrace(PTRACE_SEIZE) to pid: %d", tasks[i]);
            return false;
        }
        LOGMSG(l_DEBUG, "Successfully attached to pid/tid: %d", tasks[i]);
    }
    for (int i = 0; i < MAX_THREAD_IN_TASK && tasks[i]; i++) {
        ptrace(PT_CONTINUE, tasks[i], NULL, NULL);
    }
    return true;
}
开发者ID:rtzoeller,项目名称:honggfuzz,代码行数:25,代码来源:ptrace_utils.c


示例12: db_Delete_comm_link

// 删除链路配置信息
defGSReturn CCommLinkManager::Cfg_Delete( const defLinkID LinkID )
{
	db_Delete_comm_link( LinkID );

	Relation_DeleteForLink( LinkID );

	struDelCommLink delobj;
	delobj.delts = timeGetTime();

	//defmapCommLinkCfg::const_iterator it = this->m_CfgList.find(LinkID);
	defmapCommLinkCfg::iterator it = this->m_CfgList.find(LinkID);
	if( it != this->m_CfgList.end() )
	{
		it->second->enable = 0;
		delobj.cfgobj = it->second;
		m_CfgList.erase(it);

		LOGMSG( "CommLinkMgr:CfgList Del LinkID=%d, aftercount(%d)", LinkID, m_CfgList.size() );
	}

	delobj.runobj = Run_Remove( LinkID );

	{
		gloox::util::MutexGuard mutexguard( m_mutex_CommLinkMgr );

		m_DeleteList.push_back( delobj );
	}

	LOGMSG( "CommLinkMgr:DeleteList insert LinkID=%d, aftercount(%d)", LinkID, m_DeleteList.size() );

	return defGSReturn_Success;
}
开发者ID:asdfjkl697,项目名称:package,代码行数:33,代码来源:CommLinkManager.cpp


示例13: G_SpawnMap

void G_SpawnMap( g_map_t *map, char *path )
{
	//
	// load classes
	//
	
	SHV_Printf( " ... planes\n" );
	map->planehm = G_MapTryClassLoad( path, MAP_CLASS_NAME_PLANES );

	SHV_Printf( " ... mapnodes\n" );
	map->mapnodehm = G_MapTryClassLoad( path, MAP_CLASS_NAME_MAPNODES );

	SHV_Printf( " ... texdefs\n" );
	map->texdefhm = G_MapTryClassLoad( path, MAP_CLASS_NAME_TEXDEFS );

	SHV_Printf( " ... textures\n" );
	map->texturehm = G_MapTryClassLoad( path, MAP_CLASS_NAME_TEXTURES );

	SHV_Printf( " ... visleafs\n" );
	map->visleafhm = G_MapTryClassLoad( path, MAP_CLASS_NAME_VISLEAFS );

	SHV_Printf( " ... blockmap brushes\n" );
	map->blockmaphm = G_MapTryClassLoad( path, MAP_CLASS_NAME_BLOCKMAP );

	SHV_Printf( " ... shapes\n" );
	map->shapehm = G_MapTryClassLoad( path, MAP_CLASS_NAME_SHAPES );

	if ( !map->planehm )
		__error( "plane class load failed.\n" );
	if ( !map->mapnodehm )
		__error( "mapnode class load failed.\n" );
	if ( !map->texdefhm )
		__error( "texdef class load failed.\n" );
	if ( !map->texturehm )
		__error( "texture class loaf failed.\n" );
	if ( !map->visleafhm )
		__error( "visleaf class load failed.\n" );
	if ( !map->blockmaphm )
		__error( "blockmap class load failed.\n" );
	if ( !map->shapehm ) 
		__error( "shape class load failed.\n" );

#if 0	
	LOGMSG( " volume map ...\n" );
	map->volume_ccmap3 = G_MapTryCCMap3Load( path, MAP_CCMAP3_NAME_VOLUME );
	LOGMSG( " field map ...\n" );
	map->field_ccmap3 = G_MapTryCCMap3Load( path, MAP_CCMAP3_NAME_FIELD );
	
	if ( !map->volume_ccmap3 )
		__warning( "volume binary load failed.\n" );
	if ( !map->field_ccmap3 )
		__warning( "field binary load failed.\n" );
#endif	

}
开发者ID:3dyne,项目名称:3dyne_legacy_engine,代码行数:55,代码来源:g_map.cpp


示例14: db_phone_store

gn_error db_phone_store(void)
{
    char *begin = strdup(BEGIN_PHONE);
    char *end = strdup(END_PHONE);
    int fd;
    char buffer[256];
    int len;

    snprintf(buffer, sizeof(buffer), "%s.encode", PHONE_FILENAME_BUFFER);
    LOGMSG(LOG_LEVEL_INFO, "Will save phonebook to file %s\n", buffer);
    fd = open(buffer, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
    if (fd < 0) {
        LOGMSG(LOG_LEVEL_CRIT, "Could not open file %s for saving phonebook\n", buffer);
        goto out;
    }
    //Reset key
    reset_key();
    encode(begin, strlen(BEGIN_PHONE));
    if (safe_write(fd, begin, strlen(BEGIN_PHONE))) {
        LOGMSG(LOG_LEVEL_CRIT, "Write fail. Could not save phonebook\n");
        goto out;
    }
    phone_entry_t* entry = G_phoneBook.head;
    while(entry) {
        if (entry->next) {
            len = snprintf(buffer, sizeof(buffer), "{\"name\": \"%s\", \"phone\": \"%s\"},\n", 
                    entry->name, entry->phoneNo);
        } else {
            len = snprintf(buffer, sizeof(buffer), "{\"name\": \"%s\", \"phone\": \"%s\"}\n", 
                    entry->name, entry->phoneNo);
        }
        encode(buffer, len);
        if (safe_write(fd, buffer, len)) {
            LOGMSG(LOG_LEVEL_CRIT, "Write fail. Could not save phonebook\n");
            goto out;
        }
        entry = entry->next;
    }
    encode(end, strlen(END_PHONE));
    if (safe_write(fd, end, strlen(END_PHONE))) {
        LOGMSG(LOG_LEVEL_CRIT, "Write fail. Could not save phonebook\n");
        goto out;
    }
out:
    if (fd >= 0) {
        close(fd);
    }
    free(begin);
    free(end);
    return GN_ERR_NONE;
}
开发者ID:quancao,项目名称:zzz-vitron-01,代码行数:51,代码来源:database.c


示例15: scrape

char* scrape(int* sbufLen,uint64_t connection_id, uint32_t transaction_id, char msg[],int msgLen) {
	
	/* TODO: check if connection_id and transaction_id is known */
	int action = 2;
	int request_num;
	request_num =(msgLen-16)/20;
	LOGMSG(LOG_DEBUG,"Number of Requested Hashes: %u",request_num);
	*sbufLen = 8+request_num*12;
	char* sbuffer = malloc(*sbufLen);
 	
	#ifdef LITTLE_ENDIAN
	action = bswap_32(action);
	transaction_id = bswap_32(transaction_id);
	#endif
	
	memcpy(sbuffer,&action,4);
	memcpy(sbuffer+4,&transaction_id,4);

	#if 0
	while(request_num--) {
		char info_hash[20];
		char* info_hash_hex;

		memcpy(info_hash,msg+16+request_num*20,20);
		info_hash_hex = strToHexStr(info_hash,20);
		LOGMSG(LOG_DEBUG," Info-Hash: %s",info_hash_hex);
		int complete,downloaded,incomplete;

	
		/* TODO: number of total downloads is missing
		EVENT "complete" in announce has to be saved */
		seeders_and_leechers(info_hash_hex,&downloaded,&incomplete);
		complete = 0;	
		LOGMSG(LOG_DEBUG," Down: %u Incomp: %u",downloaded, incomplete);

		#ifdef LITTLE_ENDIAN
		complete = bswap_32(complete);
		downloaded = bswap_32(downloaded);
		incomplete = bswap_32(incomplete);
		#endif

		memcpy(sbuffer+8+request_num*12,&complete,4);
		memcpy(sbuffer+12+request_num*12,&downloaded,4);
		memcpy(sbuffer+16+request_num*12,&incomplete,4);
	}	
	
	return sbuffer;	
	#endif
	return NULL;
}
开发者ID:n0g,项目名称:racker,代码行数:50,代码来源:actions.c


示例16: LOGMSG

N2FCORE_API ControllerWebServices::~ControllerWebServices()
{
	LOGMSG("destructing");

	for ( int i = 0; i < iSupportedServices.GetSize(); ++i )
	{
		delete iSupportedServices.GetValueAt(i);
	}

	if ( iPhotoOrganise )
		delete iPhotoOrganise;

	LOGMSG("destructed");
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:14,代码来源:controllerwebservices.cpp


示例17: Ma57_set_real_parm

  void Ma57_set_real_parm( Ma57_Data *ma57, int parm, double val ) {

      switch (parm) {
      case MA57_D_PIV_THRESH:
          ma57->cntl[MA57_D_PIV_THRESH] = val;
          LOGMSG(" Set %-20s = %10.2e\n","D_PIV_THRESH",val);
          break;
      case MA57_D_PIV_NONZERO:
          ma57->cntl[MA57_D_PIV_NONZERO] = val;
          LOGMSG(" Set %-20s = %10.2e\n","D_PIV_NONZERO",val);
          break;
      }
      return;
  }
开发者ID:dpo,项目名称:lbl,代码行数:14,代码来源:ma57_lib.c


示例18: gnome_sessionmanager_control

static int gnome_sessionmanager_control(DBusGConnection *connection, int enable)
{
  GError *error;
  DBusGProxy *proxy;
  gboolean ret;

  /* Create a proxy object */
  proxy = dbus_g_proxy_new_for_name(connection,
                                    SM_SERVICE, SM_PATH, SM_INTERFACE);
  if (!proxy) {
    LOGDBG("Failed to get a proxy for " SM_SERVICE);
    return 0;
  }

  error = NULL;
  if (enable) {
    ret = dbus_g_proxy_call(proxy, "Uninhibit", &error,
                            G_TYPE_UINT, cookie,
                            G_TYPE_INVALID, G_TYPE_INVALID);
  } else {
    ret = dbus_g_proxy_call(proxy, "Inhibit", &error,
                            G_TYPE_STRING, GS_APPLICATION_NAME,
                            G_TYPE_UINT,   0,
                            G_TYPE_STRING, GS_REASON_FOR_INHIBIT,
                            G_TYPE_UINT,   12,
                            G_TYPE_INVALID,
                            G_TYPE_UINT, &cookie,
                            G_TYPE_INVALID);
  }

  g_object_unref(proxy);

  if (!ret) {
    /* Check if it's a remote exception or a regular GError */
    if (error->domain == DBUS_GERROR &&
        error->code   == DBUS_GERROR_REMOTE_EXCEPTION) {
      LOGMSG(MSG_RemoteMethodException, dbus_g_error_get_name(error), error->message);
    } else {
      LOGMSG(MSG_GError, error->message);
    }
    g_error_free(error);

    return 0;
  }

  LOGMSG(enable ? MSG_GNOMEScreensaverEnabled : MSG_GNOMEScreensaverDisabled);
  return 1;
}
开发者ID:flensrocker,项目名称:vdr-plugin-xineliboutput,代码行数:48,代码来源:gnome_screensaver.c


示例19: DumpConfig

/* Dump config to log in a readable manner */
void DumpConfig(_In_ Config* config)
{
    LOGMSG(("\tCONFIG: { class (%s); testgroup (%s); ", config->className, n_TestGroup[(int)config->testGroup]));
    LOGMSG(("\t\tInterval (%d ms); fail after (%u); fail result (%d);", config->intervalMS, config->failAfterCount, config->failResult));
    LOGMSG(("\t\tInitialize (%s); init code (%d); timeout (%d ms);", n_InitBehavior[(int)config->initBehavior], config->initResultCode, config->initTimeoutMS));
    LOGMSG(("\t\tFinalize (%s); finalize code (%d);", n_FinalizeBehavior[(int)config->finalizeBehavior], config->finalizeResultCode));
    LOGMSG(("\t\tPost behavior (%s);", n_PostBehavior[(int)config->postBehavior]));
    LOGMSG(("\t\tMisc test group (%s);", n_MiscTestGroup[(int)config->miscTestSubGroup]));
    LOGMSG(("\t\tLog Load/Unload API call (%d);", config->logLoadUnloadCall));
    LOGMSG(("\t\tLifecycle current types (%d) and supported types (%d)", config->currentSubscriptionTypes, config->supportedSubscriptionTypes));
    LOGMSG(("\t\t}"));
}
开发者ID:HuaweiSwitch,项目名称:OMI,代码行数:13,代码来源:indiprvdconfig.c


示例20: Sensor

SensorPolar2D::SensorPolar2D(unsigned int size, double angularRes, double phiMin, double maxRange, double minRange, double lowReflectivityRange) : Sensor(2, maxRange, minRange, lowReflectivityRange)
{
  _size = size;
  _data = new double[_size];
  _mask = new bool[_size];
  for(unsigned int i=0; i<_size; i++)
    _mask[i] = true;

  _angularRes = angularRes;
  _phiMin = phiMin;

  // smallest angle that lies in bounds (must be negative)
  _phiLowerBound = -0.5*_angularRes + _phiMin;

  // if angle is too large, it might be projected with modulo 2 PI to a valid index
  _phiUpperBound = _phiMin + ((double)size)*_angularRes;

  if(_phiMin>=180.0)
  {
    LOGMSG(DBG_ERROR, "Valid minimal angle < 180 degree");
  }

  _rays = new Matrix(2, _size);

  for(unsigned int i=0; i<_size; i++)
  {
    double phi = _phiMin + ((double)i) * _angularRes;
    (*_rays)(0, i) = cos(phi);
    (*_rays)(1, i) = sin(phi);
  }

  _raysLocal = new Matrix(2, size);
  *_raysLocal = *_rays;
}
开发者ID:Jonmg,项目名称:obviously,代码行数:34,代码来源:SensorPolar2D.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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