本文整理汇总了C++中log4cxx::LoggerPtr::isDebugEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ LoggerPtr::isDebugEnabled方法的具体用法?C++ LoggerPtr::isDebugEnabled怎么用?C++ LoggerPtr::isDebugEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log4cxx::LoggerPtr
的用法示例。
在下文中一共展示了LoggerPtr::isDebugEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: log4cxx_debug_dimensions
void log4cxx_debug_dimensions(const std::string& prefix, const Dimensions& dims)
{
if(logger->isDebugEnabled()) {
for (size_t i=0; i<dims.size(); i++) {
LOG4CXX_DEBUG(logger, prefix << " dims["<<i<<"] from " << dims[i].getStartMin() << " to " << dims[i].getEndMax());
}
}
}
示例2: populateDetectedBlobs_CentroidPerNeighbourBugsGroup
void TracingDemoModel::populateDetectedBlobs_CentroidPerNeighbourBugsGroup(const std::vector<BugCreature>& bugs, std::vector<DetectedBlob>& resultBlobs)
{
const float CloseBlobsDist = 7;
std::vector<uchar> processedBugs(bugs.size(), false);
for (size_t i = 0; i < bugs.size(); ++i)
{
if (processedBugs[i])
continue;
processedBugs[i] = true;
auto& bug = bugs[i];
float centroidX = bug.Pos.x();
float centroidY = bug.Pos.y();
int neighboursCount = 1;
for (size_t j = i + 1; j < bugs.size(); ++j)
{
if (processedBugs[j])
continue;
auto& nghBug = bugs[j];
float len = PoolWatch::sqr(nghBug.Pos.x() - bug.Pos.x()) + PoolWatch::sqr(nghBug.Pos.y() - bug.Pos.y());
len = std::sqrtf(len);
if (len < CloseBlobsDist)
{
centroidX += nghBug.Pos.x();
centroidY += nghBug.Pos.y();
neighboursCount++;
processedBugs[j] = true;
}
}
centroidX /= neighboursCount;
centroidY /= neighboursCount;
const int blobW = 10;
const int blobH = 10;
DetectedBlob blob;
blob.Id = i + 1;
blob.Centroid = cv::Point2f(centroidX,centroidY);
blob.CentroidWorld = cv::Point3f(centroidX, centroidY, 0);
blob.BoundingBox = cv::Rect2f(centroidX - 5, centroidY-5, blobW,blobH);
blob.FilledImage = cv::Mat(blobW, blobH, CV_8UC1);
blob.FilledImage.setTo(255);
fixBlobFilledImageRgb(bug, blobW, blobH, blob);
blob.AreaPix = blobW * blobH;
resultBlobs.push_back(blob);
}
if (log_->isDebugEnabled())
{
std::stringstream bld;
bld << "Found " << resultBlobs.size() << " blobs" << std::endl;
for (const auto& blob : resultBlobs)
bld << " Id=" << blob.Id << " Centroid=" << blob.Centroid << std::endl;
LOG4CXX_DEBUG(log_, bld.str());
}
}