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


C++ MojLogInfo函数代码示例

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


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

示例1: MojLogTrace

void AuthYahooCommand::RunImpl()
{
	MojLogTrace(m_log);
	// HACK: Hard-code partner ID and fetch of NDUID
	m_partnerId.assign("mblclt11");
	
	char id[256];
	memset(id, '\0', 256);
	
	// Read nduid, if available, otherwise make a fake one and try to record it.
	FILE * nduid = fopen("/proc/nduid", "r");
	if (!nduid) {
		nduid = fopen("yahooCachedFakeDeviceId", "r");
		if (!nduid) {
			snprintf(id, 255, "FEED0BEEF479121481533145%016llX", timeMillis());
			nduid = fopen("yahooCachedFakeDeviceId", "w");
			if (nduid) {
				fputs(id, nduid);
				fclose(nduid);
				nduid = NULL;
			}
		}
	}
	
	if (nduid) {
		if (fgets(id, 255, nduid) == NULL)
			id[0] = '\0';
		
		fclose(nduid);
		nduid = NULL;

		if (strlen(id) > 0 && id[strlen(id)-1] == '\n')
			id[strlen(id)-1] = '\0';
	}
	
	m_deviceId.assign(id);

	MojLogInfo(m_log, "Temp: partnerId=%s deviceId=%s", m_partnerId.data(), m_deviceId.data());

	MojObject accountId = m_session.GetAccount()->GetAccountId();

	MojObject params;
	MojErr err = params.put("accountId", accountId);
	ErrorToException(err);

	MojString token;
	token.assign(m_session.GetAccount()->GetYahooToken().c_str());
	err = params.put("securityToken", token);
	ErrorToException(err);

	MojLogInfo(m_log, "Looking up yahoo cookies for account %s", AsJsonString(accountId).c_str());
	// TODO: Should send the request with SmtpClient instead.
	err = m_session.CreateRequest()->send(m_getYahooCookiesSlot, "com.palm.yahoo","fetchcookies", params);
	ErrorToException(err);
}
开发者ID:Garfonso,项目名称:app-services,代码行数:55,代码来源:AuthYahooCommand.cpp

示例2: MojLogInfo

bool MojoSimpleMatcher::Match(const MojObject& response)
{
	if (!m_setupComplete) {
		MojLogInfo(s_log, _T("Simple Matcher: Setup successfully"));
		m_setupComplete = true;
		return false;
	} else {
		MojLogInfo(s_log, _T("Simple Matcher: Matched"));
		return true;
	}
}
开发者ID:edwin12345pro,项目名称:activitymanager,代码行数:11,代码来源:MojoMatcher.cpp

示例3: MojLogTrace

void ActivityManager::InteractiveYieldTimeout()
{
	MojLogTrace(s_log);
	MojLogInfo(s_log, _T("Background interactive yield timeout triggered"));

	if (m_runQueue[RunQueueReadyInteractive].empty()) {
		MojLogInfo(s_log, _T("Ready interactive queue is empty, cancelling "
			"yield timeout"));
		CancelYieldTimeout();
		return;
	}

	/* XXX make 1 more Activity yield, but only if there are fewer Activities
	 * yielding than waiting in the interactive queue. */
	unsigned waiting = (unsigned) m_runQueue[RunQueueReadyInteractive].size();
	unsigned yielding = 0;

	boost::shared_ptr<Activity> victim;

	ActivityRunQueue::iterator iter;

	for (iter = m_runQueue[RunQueueBackgroundInteractive].begin();
		iter != m_runQueue[RunQueueBackgroundInteractive].end(); ++iter) {
		if (iter->IsYielding()) {
			if (++yielding >= waiting) {
				break;
			}
		} else {
			if (!victim) {
				victim = iter->shared_from_this();
			}
		}
	}

	/* If there aren't already too many yielding... */
	if (iter == m_runQueue[RunQueueBackgroundInteractive].end()) {
		if (victim) {
			MojLogInfo(s_log, _T("Requesting that [Activity %llu] yield"),
				victim->GetId());
			victim->YieldActivity();
		} else {
			MojLogInfo(s_log, _T("All running background interactive "
				"Activities are already yielding"));
		}
	} else {
		MojLogInfo(s_log, _T("Number of yielding Activities is already equal "
			"to the number of ready interactive Activities waiting in the "
			"queue"));
	}

	UpdateYieldTimeout();
}
开发者ID:martindbenoit,项目名称:activitymanager,代码行数:52,代码来源:ActivityManager.cpp

示例4: MojLogInfo

void SyncFolderCommand::SyncFolder()
{
	PopClient::AccountPtr account = m_client.GetAccount();
	MojLogInfo(m_log, "inbox=%s, syncing folder=%s, force=%d",
				AsJsonString(account->GetInboxFolderId()).c_str(),
				AsJsonString(m_folderId).c_str(),
				m_force);
	if (m_folderId != account->GetInboxFolderId()) {
		// POP transport only supports inbox sync.
		MojLogInfo(m_log, "POP transport will skip non-inbox syncing");
		Complete();
		return;
	}

	SyncSessionPtr sSession = m_client.GetOrCreateSyncSession(m_folderId);
	m_activity = ActivityParser::GetActivityFromPayload(m_payload);
	if (!sSession->IsActive() && !sSession->IsEnding()) {
		// since sync session is not running, we can start the folder sync
		MojLogDebug(m_log, "Sync session is not active");
		StartFolderSync(m_activity);

		Complete();
	} else {
		if (m_force) {
			// Manual Sync and session is either active or ending

			// TODO: sync session is in progress, need to terminate the current
			// sync session first.  Then re-start sync session.
			StartFolderSync(m_activity);

			Complete();
		} else {
			// This is either auto sync, schedule sync, retry sync.
			if (sSession->IsActive()) {

				if (m_activity.get()) {
					MojLogInfo(m_log, "Attach sync activity to actively syncing session");

					// Adopt activity and then add it to sync session
					m_activity->Adopt(m_client);
					sSession->AttachActivity(m_activity);
				}

				Complete();
			} else if (sSession->IsEnding()) {
				// wait for sync session to end and then start folder sync
				MojLogInfo(m_log, "Waiting for ending sync session to complete");
				sSession->WaitForSessionComplete(m_syncSessionCompletedSlot);
			}
		}
	}
}
开发者ID:hatsada1,项目名称:app-services,代码行数:52,代码来源:SyncFolderCommand.cpp

示例5: MojLogInfo

/*
 * Send the messages off to libpurple transport
 */
MojErr SendOneMessageHandler::sendToTransport()
{
	MojErr err = MojErrNone;

	// can't log message text in production
	MojLogInfo (IMServiceApp::s_log, "sending message to transport. id: %s, serviceName: %s, username: %s, usernameTo: %s",
			m_currentMsgdbId.data(), m_serviceName.data(), m_username.data(), m_usernameTo.data());

	// Note, libpurple does not return errors on send - adapter only checks that the parameters are valid and that the user is logged in
	// otherwise assume success...
	LibpurpleAdapter::SendResult retVal = LibpurpleAdapter::sendMessage(m_serviceName.data(), m_username.data(), m_usernameTo.data(), m_messageText.data());

	// Now save the status
	MojObject propObject;
	if (LibpurpleAdapter::SENT == retVal) {
		// successful send
		propObject.putString(MOJDB_STATUS, IMMessage::statusStrings[Successful]);
		MojLogInfo(IMServiceApp::s_log, _T("LibpurpleAdapter::sendToTransport succeeded"));
	}
	else if (LibpurpleAdapter::USER_NOT_LOGGED_IN == retVal) {
		// user not logged in - put in queued state
		propObject.putString(MOJDB_STATUS, IMMessage::statusStrings[WaitingForConnection]);
		MojLogError(IMServiceApp::s_log, _T("LibpurpleAdapter::sendToTransport - user not logged in. waiting for connection"));
	}
	else {
		// permanent error - no retry option
		propObject.putString(MOJDB_STATUS, IMMessage::statusStrings[Undeliverable]);

		// set the error category string for the UI
		const MojChar* errorCategory = transportErrorToCategory(retVal);
		propObject.putString(MOJDB_ERROR_CATEGORY, errorCategory);
		MojLogError(IMServiceApp::s_log, _T("LibpurpleAdapter::sendToTransport failed. error %d, category %s"), retVal, errorCategory);
	}

	// id to update
	propObject.putString(MOJDB_ID, m_currentMsgdbId);

	// set server timestamp to current time.
	MojInt64 now = time (NULL);
	propObject.put(MOJDB_SERVER_TIMESTAMP, now);

	// save the new fields - call merge
	// MojErr merge(Signal::SlotRef handler, const MojObject& obj, MojUInt32 flags = MojDb::FlagNone);
	err = m_dbClient.merge(this->m_imSaveMessageSlot, propObject);
	if (err) {
		MojLogError(IMServiceApp::s_log, _T("call to merge message into DB failed. err %d, DB id %s: "), err, m_currentMsgdbId.data() );
		// request to save failed - not much we can do here...
		m_outgoingIMHandler->messageFinished();
	}

	return MojErrNone;
}
开发者ID:ChrisPHL,项目名称:webos-messaging,代码行数:55,代码来源:SendOneMessageHandler.cpp

示例6: ResponseToException

MojErr SmtpSyncOutboxCommand::FindOutgoingFolderResponse(MojObject &response, MojErr err)
{
	try {
		ResponseToException(response, err);
		MojLogInfo(m_log, "FindOutgoingFolderResponse, response elided");
	
		try {
			MojObject folder;
			DatabaseAdapter::GetOneResult(response, folder);

			m_retryDelay.clear();
			folder.get("smtpRetryDelay", m_retryDelay);
			ErrorToException(err);
                
			m_retryDelayNew = m_retryDelay;

			MojString json;
			m_retryDelay.toJson(json);
			MojLogInfo(m_log, "got retry delay %s", json.data());
			
			UpdateAccountWatchActivity();
		
		} catch(...) {
			MojLogInfo(m_log, "No outgoing folder, erroring out");
		
			// We must log an error if we cannot find the
			// appropriate outbox folder id, so that in the case
			// of a missing folder, we'll disconnect any
			// potentially left-over watches, and not come back
			// up until the account watches trigger us to update
			// and try again.
			
			m_error.errorCode = MailError::SMTP_OUTBOX_UNAVAILABLE;
			m_error.errorOnAccount = true;
			m_error.errorOnEmail = false;
			m_error.internalError = "Unable to establish outbox folder associated with SMTP account";
			m_error.errorText = "";
			SmtpSyncOutboxCommand::CompleteAndUpdateActivities();
			
			return MojErrNone;
		}

	} catch (std::exception & e) {
		HandleException(e, __func__);
	} catch (...) {
		HandleException(__func__);
	}
        
	return MojErrNone;
}
开发者ID:Garfonso,项目名称:app-services,代码行数:50,代码来源:SmtpSyncOutboxCommand.cpp

示例7: MojLogTrace

bool MojoWhereMatcher::Match(const MojObject& response)
{
	MojLogTrace(s_log);

	if (CheckClauses(m_where, response)) {
		MojLogInfo(s_log, _T("Where Matcher: Response %s matches"),
			MojoObjectJson(response).c_str());
		return true;
	} else {
		MojLogInfo(s_log, _T("Where Matcher: Response %s does not match"),
			MojoObjectJson(response).c_str());
		return false;
	}
}
开发者ID:edwin12345pro,项目名称:activitymanager,代码行数:14,代码来源:MojoMatcher.cpp

示例8: MojLogTrace

bool MojoNewWhereMatcher::Match(const MojObject& response)
{
	MojLogTrace(s_log);

	MatchResult result = CheckClause(m_where, response, AndMode);
	if (result == Matched) {
		MojLogInfo(s_log, _T("Where Matcher: Response %s matches"),
			MojoObjectJson(response).c_str());
		return true;
	} else {
		MojLogInfo(s_log, _T("Where Matcher: Response %s does not match"),
			MojoObjectJson(response).c_str());
		return false;
	}
}
开发者ID:edwin12345pro,项目名称:activitymanager,代码行数:15,代码来源:MojoWhereMatcher.cpp

示例9: MojLogInfo

void SyncSession::UpdateActivities()
{
	MojLogInfo(m_log, "updating sync session %p activities", this);

	if (m_accountError.errorCode != MailError::NONE) {
		MojLogInfo(m_log, "--- account error: [%d]%s", m_accountError.errorCode, m_accountError.errorText.c_str());
	}

	if(PopErrors::IsRetryError(m_accountError)) {
		m_client.ScheduleRetrySync(m_accountError);
	} else {
		UpdateScheduledSyncActivity();
		UpdateRetryActivity();
	}
}
开发者ID:hatsada1,项目名称:app-services,代码行数:15,代码来源:SyncSession.cpp

示例10: MojLogInfo

void SmtpSyncOutboxCommand::UpdateAccountWatchActivity()
{
	MojLogInfo(m_log, "UpdatingAccountWatchActivity");
	
	try {
		// accoundId json object
		MojString accountIdJson;
		MojErr err = m_accountId.toJson(accountIdJson);
		ErrorToException(err);

		SmtpActivityFactory factory;
		ActivityBuilder ab;

		factory.BuildSmtpConfigWatch(ab, m_accountId, m_accountRev);

		bool updating = m_accountWatchActivity.get();

		// and either update and complete the updated activity if we had adopted it, or re-create it.
		
		if ( updating ) {
			
			MojLogInfo(m_log, "updating account watch activity");
	
			m_accountWatchActivity->SetSlots(m_accountActivityUpdatedSlot, m_accountActivityErrorSlot);
	
			m_accountWatchActivity->UpdateAndComplete(m_client, ab.GetActivityObject());
			
		} else {
			// Create payload
			MojObject payload;
			err = payload.put("activity", ab.GetActivityObject());
			ErrorToException(err);
			err = payload.put("start", true);
			ErrorToException(err);
			err = payload.put("replace", true);
			ErrorToException(err);
				
			MojLogInfo(m_log, "creating account watch activity");
							
			m_client.SendRequest(m_createAccountWatchActivityResponseSlot, "com.palm.activitymanager", "create", payload);
		}

	} catch (std::exception & e) {
		HandleException(e, __func__);
	} catch (...) {
		HandleException(__func__);
	}
}
开发者ID:Garfonso,项目名称:app-services,代码行数:48,代码来源:SmtpSyncOutboxCommand.cpp

示例11: CommandTraceFunction

MojErr AccountFinderCommand::GetPasswordResponse(MojObject& response, MojErr err)
{
	CommandTraceFunction();

	try {
		// check the result first
		ErrorToException(err);

		MojObject credentials;
		// Credentials object can be missing if the POP account is restored from
		// backup.  Checking for its existence before using it will prevent exception
		// to be thrown.
		bool exists = response.get("credentials", credentials);
		if (exists) {
			MojString password;
			err = credentials.getRequired("password", password);
			ErrorToException(err);

			m_account->SetPassword(password.data());
		} else {
			MojLogInfo(m_log, "The credentials of POP account '%s' are missing", AsJsonString(m_accountId).c_str());
		}

		// get the transport object
		GetPopAccount();
	} catch (const std::exception& ex) {
		Failure(ex);
	} catch (...) {
		Failure(MailException("unknown exception", __FILE__, __LINE__));
	}

	return MojErrNone;
}
开发者ID:Garfonso,项目名称:app-services,代码行数:33,代码来源:AccountFinderCommand.cpp

示例12: MojLogInfo

/*
 * inviteBuddy: tell libpurple to add the buddy
 * add buddy to buddyStatus and contact DB kinds
 *
 * imcommand:
 * {
   "params" : {
      "group"            : {"type"        : "string",
                            "optional"    : true,
                            "description" : "The name of the group to put the buddy in."},
      "message"          : {"type"        : "string",
                            "optional"    : true,
                            "description" : "If the IM transport supports custom invite messages."}
     }
 * }
 *
 */
LibpurpleAdapter::SendResult SendOneCommandHandler::inviteBuddy(const MojObject imCmd) {

	bool found = false;

	// params
	MojObject params;
	MojString group;
	found = imCmd.get(MOJDB_PARAMS, params);
	IMServiceHandler::logMojObjectJsonString(_T("command params: %s"),params);
	if (found) {
		params.get(XPORT_GROUP, group, found);
	}

	MojLogInfo (IMServiceApp::s_log, "sending addBuddy command to transport. id: %s, serviceName: %s, username: %s, buddyUsername: %s, groupName: %s",
			m_currentCmdDbId.data(), m_serviceName.data(), m_username.data(), m_buddyName.data(), group.data());

	// Note, libpurple does not return errors on send - adapter only checks that the parameters are valid and that the user is logged in
	// otherwise assume success...
	LibpurpleAdapter::SendResult retVal = LibpurpleAdapter::addBuddy(m_serviceName.data(), m_username.data(), m_buddyName.data(), group.data());

	// Note: if the remote user rejects our invite, buddy gets deleted on the server but we do not get notified, so the contact will remain, but the buddy list gets re-synced on the next login

	if (LibpurpleAdapter::SENT == retVal) {
		// add to buddyStatus and contacts list. They will get removed later if the invite is rejected
		addBuddyToDb();
	}
	return retVal;
}
开发者ID:wosigh,项目名称:messaging-plugins,代码行数:45,代码来源:SendOneCommandHandler.cpp

示例13: MojLogInfo

void SmtpSendMailCommand::GetEmail()
{
	try {
		// Get the email from the database
		MojLogInfo(m_log, "trying GetOutboxEmail query");

		m_session.GetDatabaseInterface().GetOutboxEmail(m_getEmailSlot, m_emailId);

		MojLogInfo(m_log, "started GetOutboxEmail query");

	} catch (const std::exception& e) {
		HandleException(e, __func__, __FILE__, __LINE__);
	} catch (...) {
		HandleUnknownException();
	}
}
开发者ID:Garfonso,项目名称:app-services,代码行数:16,代码来源:SmtpSendMailCommand.cpp

示例14: MojAssert

MojErr MojDbIsamQuery::count(MojUInt32& countOut)
{
	MojAssert(m_isOpen);

	countOut = 0;
	MojInt32 warns = 0;
	m_plan->limit(MojUInt32Max);
	bool found = false;
	do {
		// Iterate over all the db results but only count
		// the ones that would not be excluded.  If we're not
		// excluding any kinds, getImpl does not need to get the
		// storage item.
		MojDbStorageItem* item = NULL;
		//MojErr err = getImpl(item, found, !m_excludeKinds.empty());  // orig
		//to ensure that we do not count ghost keys, me need to always try to get the item as well
		MojErr err = getImpl(item, found, true);
		if (err == MojErrInternalIndexOnFind) {
			found = true;			// to continue with counting
			warns++;
			continue;			// we ignore such keys; it is not counted in getImpl either
		}
		MojErrCheck(err);
	} while (found);
	countOut = m_count;
	if (warns > 0) {
		const MojChar * from = m_plan->query().from().data();
		MojLogInfo(MojDb::s_log, _T("isamquery_count: from: %s; indexid: %zu; warnings: %d \n"),
								 from, m_plan->idIndex(), warns);
	}
	return MojErrNone;
}
开发者ID:KyleMaas,项目名称:db8,代码行数:32,代码来源:MojDbIsamQuery.cpp

示例15: MojLogTrace

// Returns the filename of a cachedObject
const std::string
CFileCacheSet::CachedObjectFilename(const cachedObjectId_t objId) {

  MojLogTrace(s_log);

  std::string retVal;
  const std::string typeName(GetTypeForObjectId(objId));
  if (!typeName.empty()) {
    CFileCache* fileCache = GetFileCacheForType(typeName);
    if (fileCache != NULL) {
      retVal = fileCache->GetObjectFilename(objId);
      MojLogInfo(s_log,
		 _T("CachedObjectFilename: Object '%llu' has name '%s'."),
		 objId, retVal.c_str());
    } else {
      MojLogWarning(s_log,
		    _T("CachedObjectFilename: No cache of type '%s' found for id '%llu'."),
		    typeName.c_str(), objId);
    }
  } else {
    MojLogWarning(s_log,
		  _T("CachedObjectFilename: Cache type not found for id '%llu'."),
		  objId);
  }

  return retVal;

}
开发者ID:uncle22,项目名称:filecache,代码行数:29,代码来源:FileCacheSet.cpp


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