本文整理汇总了C++中LOG4CXX_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG4CXX_TRACE函数的具体用法?C++ LOG4CXX_TRACE怎么用?C++ LOG4CXX_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOG4CXX_TRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG4CXX_TRACE
void Simulator::plotParticles(int iteration) {
outputWriter::VTKWriter vtkWriter;
outputWriter::XYZWriter xyzWriter;
#ifndef NOGLVISUALIZER
if(Settings::show3DVisual) {
outputWriter::RenderOutputWriter openglView;
LOG4CXX_TRACE(logger,"Plotting Particles");
openglView.plotParticles(*particleContainer, Settings::outputFilePrefix, iteration);
}
#endif
if(Settings::disableOutput) return;
switch (Settings::outputFileType) {
case OutputFileType::xyz:
xyzWriter.plotParticles(*particleContainer, Settings::outputFilePrefix, iteration);
break;
case OutputFileType::vtk:
vtkWriter.initializeOutput(particleContainer->getSize());
particleContainer->each([&] (Particle& p) {
#ifdef _OPENMP
#pragma omp critical (plot_particle)
#endif
vtkWriter.plotParticle(p);
});
vtkWriter.writeFile(Settings::outputFilePrefix, iteration);
break;
}
LOG4CXX_TRACE(logger,"Plotted \t"<< iteration << "\t Particles" );
}
示例2: LOG4CXX_TRACE
std::shared_ptr<Module<Impl>>
Module_scanner<Impl>::instantiate_module_template(Label inst_name,
ast::Module_def const* node,
std::map<Label,std::shared_ptr<Type<Impl>>> const& args) {
LOG4CXX_TRACE(this->m_logger, "creating module '"
<< inst_name << "' from template");
auto existing = m_mod.modules.find(inst_name);
if( existing != m_mod.modules.end() )
return existing->second;
auto m = std::make_shared<Module<Impl>>(inst_name);
m->enclosing_ns = &m_mod;
m->enclosing_library = m_mod.enclosing_library;
// inject type arguments
for(auto ty : args) {
LOG4CXX_TRACE(this->m_logger, "overriding type parameters '"
<< ty.first << "' with type '"
<< ty.second->name << "'");
m->types[ty.first] = ty.second;
}
Module_scanner<Impl> scanner(*m);
node->accept(scanner);
m_mod.modules[m->name] = m;
return m;
}
示例3: assert
void ReplicationManager::handleConnectionStatus(Notification<NetworkManager::ConnectionStatus>::MessageTypePtr connStatus)
{
assert(connStatus->getPhysicalInstanceId() != INVALID_INSTANCE);
LOG4CXX_TRACE(logger, "ReplicationManager::handleConnectionStatus: notification for instance="
<< connStatus->getPhysicalInstanceId()
<< ", remote receive queue size="
<< connStatus->getAvailabeQueueSize());
if (connStatus->getQueueType() != NetworkManager::mqtReplication)
{
return;
}
if (connStatus->getAvailabeQueueSize() <= 0)
{
return;
}
ScopedMutexLock cs(_repMutex);
RepQueue::iterator iter = _repQueue.find(connStatus->getPhysicalInstanceId());
if (iter == _repQueue.end()) {
return;
}
LOG4CXX_TRACE(logger, "ReplicationManager::handleConnectionStatus: notification for instance="
<< connStatus->getPhysicalInstanceId()
<< ", local replication queue size="<< iter->second->size()
<< ", remote receive queue size="<< connStatus->getAvailabeQueueSize());
_repEvent.signal();
}
示例4: LOG4CXX_DEBUG
// XXX TODO: consider returning std::vector<scidb::SharedMemoryPtr>
// XXX TODO: which would require supporting different types of memory (double, char etc.)
std::vector<MPIPhysical::SMIptr_t> MPIPhysical::allocateMPISharedMemory(size_t numBufs,
size_t elemSizes[],
size_t numElems[],
string dbgNames[])
{
LOG4CXX_DEBUG(logger, "MPIPhysical::allocateMPISharedMemory(numBufs "<<numBufs<<",,,)");
if(logger->isTraceEnabled()) {
LOG4CXX_TRACE(logger, "MPIPhysical::allocateMPISharedMemory(): allocations are: ");
for(size_t ii=0; ii< numBufs; ii++) {
LOG4CXX_TRACE(logger, "MPIPhysical::allocateMPISharedMemory():"
<< " elemSizes["<<ii<<"] "<< dbgNames[ii] << " len " << numElems[ii]);
}
}
std::vector<SMIptr_t> shmIpc(numBufs);
bool preallocate = Config::getInstance()->getOption<bool>(CONFIG_PREALLOCATE_SHM);
for(size_t ii=0; ii<numBufs; ii++) {
std::stringstream suffix;
suffix << "." << ii ;
std::string ipcNameFull= _ipcName + suffix.str();
LOG4CXX_TRACE(logger, "IPC name = " << ipcNameFull);
shmIpc[ii] = SMIptr_t(mpi::newSharedMemoryIpc(ipcNameFull, preallocate)); // can I get 'em off ctx instead?
_ctx->addSharedMemoryIpc(_launchId, shmIpc[ii]);
char* ptr = MpiLauncher::initIpcForWrite(shmIpc[ii].get(), (elemSizes[ii] * numElems[ii]));
assert(ptr); ptr=ptr;
}
return shmIpc;
}
示例5: DetourWeCreateProcessA
BOOL WINAPI DetourWeCreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
{
//LOG4CXX_TRACE(NYDWE::gInjectLogger, boost::format("ApplicationName: %1%") % lpApplicationName);
//LOG4CXX_TRACE(NYDWE::gInjectLogger, boost::format("CommandLine: %1%") % lpCommandLine);
std::cmatch matcher;
if (lpCommandLine && std::regex_match(lpCommandLine, matcher, gRegexCommandLine))
{
std::string currentWarcraftMap = (ydwe::path::get(ydwe::path::DIR_EXE).remove_filename() / matcher.str(1)).string();
LOG4CXX_TRACE(NYDWE::gInjectLogger, boost::format("Executing map %1%") % currentWarcraftMap);
CYDWEEventData eventData;
if (gIsInCompileProcess)
{
LOG4CXX_TRACE(NYDWE::gInjectLogger, "Need to compile...");
eventData.setEventData("map_path", currentWarcraftMap);
const std::vector<int> &results = event_array[EVENT_SAVE_MAP](eventData);
gIsInCompileProcess = false;
if (results_is_failed(results))
{
LOG4CXX_TRACE(NYDWE::gInjectLogger, "Save failed. Abort testing.");
memset(lpProcessInformation, 0, sizeof(PROCESS_INFORMATION));
return FALSE;
}
}
else
{
LOG4CXX_TRACE(NYDWE::gInjectLogger, "No need to compile.");
}
eventData.getDataStore().clear();
eventData.setEventData("map_path", currentWarcraftMap);
if (lpApplicationName)
eventData.setEventData("application_name", std::string(lpApplicationName));
if (lpCommandLine)
eventData.setEventData("command_line", std::string(lpCommandLine));
const std::vector<int> &results = event_array[EVENT_TEST_MAP](eventData);
return (!results_is_failed(results));
}
else
{
// Retain original
return aero::std_call<BOOL>(pgTrueCreateProcessA,
lpApplicationName,
lpCommandLine,
lpProcessAttributes,
lpThreadAttributes,
bInheritHandles,
dwCreationFlags,
lpEnvironment,
lpCurrentDirectory,
lpStartupInfo,
lpProcessInformation
);
}
}
示例6: sScope
bool RemoteMergedArray::proceedChunkMsg(size_t stream, AttributeID attId, MemChunk* chunk)
{
boost::shared_ptr<MessageDesc> chunkDesc = _messages[attId][stream];
_messages[attId][stream].reset();
boost::shared_ptr<scidb_msg::Chunk> chunkMsg = chunkDesc->getRecord<scidb_msg::Chunk>();
StatisticsScope sScope(_statistics);
currentStatistics->receivedSize += chunkDesc->getMessageSize();
currentStatistics->receivedMessages++;
_nextPositions[attId][stream].clear();
if (!chunkMsg->eof())
{
LOG4CXX_TRACE(logger, "RemoteMergedArray received next chunk message");
if (chunkDesc->getBinary() && chunk != NULL)
{
const int compMethod = chunkMsg->compression_method();
const size_t decompressedSize = chunkMsg->decompressed_size();
Address firstElem;
firstElem.attId = attId;
firstElem.arrId = getArrayDesc().getId();
for (int i = 0; i < chunkMsg->coordinates_size(); i++) {
firstElem.coords.push_back(chunkMsg->coordinates(i));
}
chunk->initialize(this, &desc, firstElem, compMethod);
chunk->setSparse(chunkMsg->sparse());
chunk->setRLE(chunkMsg->rle());
chunk->setCount(chunkMsg->count());
boost::shared_ptr<CompressedBuffer> compressedBuffer = dynamic_pointer_cast<CompressedBuffer>(chunkDesc->getBinary());
compressedBuffer->setCompressionMethod(compMethod);
compressedBuffer->setDecompressedSize(decompressedSize);
chunk->decompress(*compressedBuffer);
assert(checkChunkMagic(*chunk));
LOG4CXX_TRACE(logger, "RemoteMergedArray initializes next chunk");
}
LOG4CXX_TRACE(logger, "RemoteMergedArray initializes next position");
if (chunkMsg->has_next())
{
for (int i = 0; i < chunkMsg->next_coordinates_size(); i++) {
_nextPositions[attId][stream].push_back(chunkMsg->next_coordinates(i));
}
requestNextChunk(stream, attId, false);
}
return true;
}
else
{
LOG4CXX_TRACE(logger, "RemoteMergedArray has no new chunks");
return false;
}
}
示例7: LOG4CXX_ERROR
/* Clear all datastore files from the basepath
*/
void
DataStores::clearAllDataStores()
{
/* Try to open the base dir
*/
DIR* dirp = ::opendir(_basePath.c_str());
if (dirp == NULL)
{
LOG4CXX_ERROR(logger, "DataStores::clearAllDataStores: failed to open base dir, aborting clearAll");
return;
}
boost::function<int()> f = boost::bind(&File::closeDir, _basePath.c_str(), dirp, false);
scidb::Destructor<boost::function<int()> > dirCloser(f);
struct dirent entry;
memset(&entry, 0, sizeof(entry));
/* For each entry in the base dir
*/
while (true)
{
struct dirent *result(NULL);
int rc = ::readdir_r(dirp, &entry, &result);
if (rc != 0 || result == NULL)
{
return;
}
assert(result == &entry);
LOG4CXX_TRACE(logger, "DataStores::clearAllDataStores: found entry " << entry.d_name);
/* If its a datastore or fl file, go ahead and try to remove it
*/
size_t entrylen = strlen(entry.d_name);
size_t fllen = strlen(".fl");
size_t datalen = strlen(".data");
const char* entryend = entry.d_name + entrylen;
/* Check if entry ends in ".fl" or ".data"
*/
if (((entrylen > fllen) &&
(strcmp(entryend - fllen, ".fl") == 0)) ||
((entrylen > datalen) &&
(strcmp(entryend - datalen, ".data") == 0))
)
{
LOG4CXX_TRACE(logger, "DataStores::clearAllDataStores: deleting entry " << entry.d_name);
std::string fullpath = _basePath + "/" + entry.d_name;
File::remove(fullpath.c_str(), false);
}
}
}
示例8: LOG4CXX_TRACE
void Resources::fileExists(const string &path, map<InstanceID, bool> &instancesMap, const shared_ptr<Query> &query)
{
LOG4CXX_TRACE(logger, "Resources::fileExists. Checking file '" << path << "'");
NetworkManager* networkManager = NetworkManager::getInstance();
FileExistsResourcesCollector* collector = new FileExistsResourcesCollector();
uint64_t id = 0;
{
ScopedMutexLock lock(_lock);
id = ++_lastResourceCollectorId;
_resourcesCollectors[id] = collector;
collector->collect(query->getInstanceID(), checkFileExists(path), false);
}
shared_ptr<MessageDesc> msg = make_shared<MessageDesc>(mtResourcesFileExistsRequest);
shared_ptr<scidb_msg::ResourcesFileExistsRequest> request =
msg->getRecord<scidb_msg::ResourcesFileExistsRequest>();
msg->setQueryID(0);
request->set_resource_request_id(id);
request->set_file_path(path);
networkManager->broadcast(msg);
LOG4CXX_TRACE(logger, "Resources::fileExists. Waiting while instances return result for collector " << id);
try
{
Semaphore::ErrorChecker errorChecker = bind(&Query::validateQueryPtr, query);
collector->_collectorSem.enter(query->getInstancesCount() - 1, errorChecker);
}
catch (...)
{
LOG4CXX_TRACE(logger, "Resources::fileExists. Waiting for result of collector " << id <<
" interrupter by error");
{
ScopedMutexLock lock(_lock);
delete _resourcesCollectors[id];
_resourcesCollectors.erase(id);
}
throw;
}
LOG4CXX_TRACE(logger, "Resources::fileExists. Returning result of collector " << id);
{
ScopedMutexLock lock(_lock);
instancesMap = ((FileExistsResourcesCollector*) _resourcesCollectors[id])->_instancesMap;
delete _resourcesCollectors[id];
_resourcesCollectors.erase(id);
}
}
示例9: test6
void test6()
{
log4cxx::PropertyConfigurator::configure("log4cxx.properties");
log4cxx::LoggerPtr loggerA(log4cxx::Logger::getLogger("aaa"));
log4cxx::LoggerPtr loggerB(log4cxx::Logger::getLogger("bbb"));
LOG_F("\n");
LOG4CXX_INFO(loggerA, "this is log4cxx test");
LOG4CXX_INFO(loggerB, "this is log4cxx test");
log4cxx::LoggerPtr logger0(log4cxx::Logger::getLogger("logger0"));
LOG4CXX_DEBUG(logger0, "hello");
LOG4CXX_TRACE(logger0, "hello");
LOG4CXX_INFO(logger0, "hello");
LOG4CXX_WARN(logger0, "hello");
LOG4CXX_ERROR(logger0, "hello");
LOG4CXX_FATAL(logger0, "hello");
// std::set<int> cList;
// LOG4CXX_INFO(logger0, cList);
//log4j.logger.logger0 = INFO, ap0
// INFO 23:02:03 -- hello
// WARN 23:02:04 -- hello
// ERROR 23:02:04 -- hello
// FATAL 23:02:04 -- hello
LOG_F("\n");
}
示例10: Graph_read
static bool Graph_read(Graph& graph, std::istream& stream) {
if (!stream) {
return false;
}
// s.t. con3122 : x_2250 - x_2866 + e_2866_2250 = 190;
static boost::regex reg("s\\.t\\. con(\\d+)\\s*:\\s*x_(\\d+)\\s*-\\s*x_(\\d+)\\s*\\+\\s*e_(\\d+)_(\\d+)\\s*=\\s*((\\+|-)?\\d+)\\s*;");
std::string line;
while (std::getline(stream, line)) {
boost::algorithm::trim(line);
boost::smatch what;
if (boost::regex_match(line, what, reg)) {
size_t xj = boost::lexical_cast< size_t >(what[2]);
size_t xi = boost::lexical_cast< size_t >(what[3]);
int err = boost::lexical_cast< int >(what[6]);
LOG4CXX_TRACE(logger, boost::format("regex: %d %d %d %s") % xi % xj % err % line);
Graph_addEdge(graph, xi, xj, err);
}
}
return true;
}
示例11: _dsm
/* Construct a new DataStore object
*/
DataStore::DataStore(char const* filename, Guid guid, DataStores& parent) :
_dsm(&parent),
_dslock(),
_guid(guid),
_largestFreeChunk(0),
_dirty(false),
_fldirty(false)
{
/* Open the file
*/
string filenamestr = filename;
_file = FileManager::getInstance()->openFileObj(filenamestr.c_str(), O_LARGEFILE | O_RDWR | O_CREAT);
if (_file.get() == NULL)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_STORAGE,
SCIDB_LE_CANT_OPEN_FILE)
<< filenamestr << errno;
}
LOG4CXX_TRACE(logger, "datastore: new ds opened file " << filenamestr);
/* Try to initialize the free lists from the free-list file.
*/
initializeFreelist();
}
示例12: cs
bool ReplicationManager::sendItem(RepItems& ri)
{
ScopedMutexLock cs(_repMutex);
const std::shared_ptr<Item>& item = ri.front();
if (item->isDone()) {
ri.pop_front();
return true;
}
try {
std::shared_ptr<Query> q(Query::getValidQueryPtr(item->getQuery()));
std::shared_ptr<MessageDesc> chunkMsg(item->getChunkMsg());
NetworkManager::getInstance()->sendPhysical(item->getInstanceId(), chunkMsg,
NetworkManager::mqtReplication);
LOG4CXX_TRACE(logger, "ReplicationManager::sendItem: successful replica chunk send to instance="
<< item->getInstanceId()
<< ", size=" << item->getChunkMsg()->getMessageSize()
<< ", query (" << q->getQueryID()<<")"
<< ", queue size="<< ri.size());
InjectedErrorListener<ReplicaSendInjectedError>::check();
item->setDone();
} catch (NetworkManager::OverflowException& e) {
assert(e.getQueueType() == NetworkManager::mqtReplication);
return false;
} catch (Exception& e) {
item->setDone(e.copy());
}
ri.pop_front();
return true;
}
示例13: LOG4CXX_TRACE
/* Invalidate the free-list file on disk
@pre caller has locked the DataStore
*/
void
DataStore::invalidateFreelistFile()
{
if (!_fldirty)
{
File::FilePtr flfile;
std::string filename;
size_t nbuckets = 0;
LOG4CXX_TRACE(logger, "datastore: invalidating freelist for " << _file->getPath());
filename = _file->getPath() + ".fl";
flfile = FileManager::getInstance()->openFileObj(filename, O_CREAT | O_TRUNC | O_RDWR);
if (!flfile)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_STORAGE, SCIDB_LE_CANT_OPEN_PATH)
<< filename;
}
/* This is one vulnerable spot... after truncate, but before we write the zero byte
*/
_dsm->getErrorListener().check();
flfile->writeAll((void*)&nbuckets, sizeof(size_t), 0);
flfile->fsync();
_fldirty = true;
_dsm->getFlusher().add(_guid);
}
}
示例14: LOG4CXX_TRACE
void VTKWriter::plotParticle(Particle& p) {
if (vtkFile->UnstructuredGrid().present()) {
LOG4CXX_TRACE(iolog, "UnstructuredGrid is present");
} else {
LOG4CXX_ERROR(iolog, "No UnstructuredGrid present");
}
PointData::DataArray_sequence& pointDataSequence = vtkFile->UnstructuredGrid()->Piece().PointData().DataArray();
PointData::DataArray_iterator dataIterator = pointDataSequence.begin();
dataIterator->push_back(p.getM());
//cout << "Appended mass data in: " << dataIterator->Name();
dataIterator++;
dataIterator->push_back(p.getV()[0]);
dataIterator->push_back(p.getV()[1]);
dataIterator->push_back(p.getV()[2]);
//cout << "Appended velocity data in: " << dataIterator->Name();
dataIterator++;
dataIterator->push_back(p.getOldF()[0]);
dataIterator->push_back(p.getOldF()[1]);
dataIterator->push_back(p.getOldF()[2]);
//cout << "Appended force data in: " << dataIterator->Name();
dataIterator++;
dataIterator->push_back(p.getType());
Points::DataArray_sequence& pointsSequence = vtkFile->UnstructuredGrid()->Piece().Points().DataArray();
Points::DataArray_iterator pointsIterator = pointsSequence.begin();
pointsIterator->push_back(p.getX()[0]);
pointsIterator->push_back(p.getX()[1]);
pointsIterator->push_back(p.getX()[2]);
}
示例15: LOG4CXX_DEBUG
void CuboidInitializer::initialize(ParticleContainer& container) {
double x[] = {0,0,0};
double m = _config.getMaterialConfig().getM();
double epsilon = _config.getMaterialConfig().getEpsilon();
double sigma = _config.getMaterialConfig().getSigma();
LOG4CXX_DEBUG(logger, "SphereInitializer material: m=" << m << " epsilon=" << epsilon << " sigma=" << sigma);
const utils::Vector<double,3>& v = _config.getV();
const utils::Vector<int, 3>& n = _config.getN();
LOG4CXX_DEBUG(logger, "Initializing CUBE at " << _config.getX().toString());
for (int i = 0; i < n[0]; i++) {
for (int j = 0; j < n[1]; j++) {
for (int k = 0; k < n[2]; k++) {
x[0] = _config.getX()[0] + ((double)i) * _config.getH();
x[1] = _config.getX()[1] + ((double)j) * _config.getH();
x[2] = _config.getX()[2] + ((double)k) * _config.getH();
LOG4CXX_TRACE(logger, "creating (x,y,z): (" << x[i] << "," << x[j] << "," << x[k] << ")");
Particle p(x, v, m, epsilon, sigma, _type_id);
//MaxwellBoltzmannDistribution(p, 0.1, dim);
container.addParticle(p);
}
}
}
}