本文整理汇总了C++中LogSink::warn方法的典型用法代码示例。如果您正苦于以下问题:C++ LogSink::warn方法的具体用法?C++ LogSink::warn怎么用?C++ LogSink::warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogSink
的用法示例。
在下文中一共展示了LogSink::warn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolve
DNS::HostMap DNS::resolve( const std::string& service, const std::string& proto,
const std::string& domain, const LogSink& logInstance )
{
logInstance.warn( LogAreaClassDns, "notice: gloox does not support SRV "
"records on this platform. Using A records instead." );
return defaultHostMap( domain, logInstance );
}
示例2: defaultHostMap
DNS::HostMap DNS::defaultHostMap( const std::string& domain, const LogSink& logInstance )
{
HostMap server;
logInstance.warn( LogAreaClassDns, "notice: no SRV record found for "
+ domain + ", using default port." );
if( !domain.empty() )
server[domain] = XMPP_PORT;
return server;
}
示例3: resolve
DNS::HostMap DNS::resolve( const std::string& service, const std::string& proto,
const std::string& domain, const LogSink& logInstance )
{
const std::string dname = "_" + service + "._" + proto + "." + domain;
bool error = false;
DNS::HostMap servers;
DNS_RECORD* pRecord = NULL;
DNS_STATUS status = DnsQuery_UTF8( dname.c_str(), DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &pRecord, NULL );
if( status == ERROR_SUCCESS )
{
// NOTE: DnsQuery_UTF8 and DnsQuery_A really should have been defined with
// PDNS_RECORDA instead of PDNS_RECORD, since that's what it is (even with _UNICODE defined).
// We'll correct for that mistake with a cast.
DNS_RECORDA* pRec = (DNS_RECORDA*)pRecord;
do
{
if( pRec->wType == DNS_TYPE_SRV )
{
servers[pRec->Data.SRV.pNameTarget] = pRec->Data.SRV.wPort;
}
pRec = pRec->pNext;
}
while( pRec != NULL );
DnsRecordListFree( pRecord, DnsFreeRecordList );
}
else
{
logInstance.warn( LogAreaClassDns, "DnsQuery_UTF8() failed: " + util::int2string( status ) );
error = true;
}
if( error || !servers.size() )
{
servers = defaultHostMap( domain, logInstance );
}
return servers;
}