openModeller
Version 1.5.0
|
#include <Log.hh>
Classes | |
class | LogCallback |
class | OstreamCallback |
Public Types | |
enum | Level { Debug =0, Default =1, Info =2, Warn =3, Error =4 } |
Public Member Functions | |
~Log () | |
void | set (Level level, std::string fileName, char const *pref="") |
void | setCallback (LogCallback *lc) |
void | setLevel (Level level) |
void | setPrefix (const char *pref) |
void | debug (const char *format,...) |
'Debug' level. More... | |
void | info (const char *format,...) |
'Info' level. More... | |
void | warn (const char *format,...) |
'Warn' level. More... | |
void | error (const char *format,...) |
'Error' level. More... | |
void | operator() (const char *format,...) |
Static Public Member Functions | |
static Log * | instance () |
Returns the instance pointer, creating the object on the first call. More... | |
static std::string | format (const char *fmt,...) |
Protected Member Functions | |
Log () | |
Private Member Functions | |
void | FormatAndWrite (Log::LogCallback &lc, Log::Level level, std::string pref, const char *format, va_list ap) |
Private Attributes | |
LogCallback * | callback |
Level | _level |
std::string | _pref |
bool | _deleteCallback |
Static Private Attributes | |
static Log * | mpInstance = 0 |
Declaration of Log class.
LICENSE INFORMATION
Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html A Singleton Class that allows sending of log messages to "stream" devices. A system interface class with more advanced logging mechanisms (libraries).
enum Log::Level |
|
protected |
Protected constructor
Definition at line 171 of file Log.cpp.
References _deleteCallback, _level, Debug, and setPrefix().
Referenced by instance().
Log::~Log | ( | ) |
Definition at line 183 of file Log.cpp.
References _deleteCallback, and callback.
void Log::debug | ( | const char * | format, |
... | |||
) |
'Debug' level.
Definition at line 237 of file Log.cpp.
References _level, _pref, callback, Debug, and FormatAndWrite().
Referenced by AquaMaps::_calculateEnvelopes(), RocCurve::_calculateGraphPoints(), RocCurve::_loadPredictions(), AquaMaps::_readSpeciesData(), AlgorithmImpl::AlgorithmImpl(), ConfusionMatrix::calculate(), OpenModeller::calculateModelStatistics(), Csm::center(), EnvironmentImpl::checkCoordinates(), ScaleNormalizer::computeNormalization(), MapFormat::copyDefaults(), OccurrencesFactory::create(), Csm::csm1(), CsmBS::discardComponents(), NNAlgorithm::done(), RocCurve::getPartialAreaRatio(), EnvironmentImpl::getUnnormalizedInternal(), EnvironmentalDistance::initialize(), AlgorithmRun::initialize(), CsmBS::initialize(), CacheManager::initialize(), NNAlgorithm::initialize(), Csm::initialize(), initialPluginPath(), initRandom(), BestSubsets::iterate(), DelimitedTextOccurrences::load(), Settings::loadConfig(), main(), AlgorithmFactory::newAlgorithm(), ReferenceCountedPointer< T >::operator=(), AlgorithmFactory::p_addDll(), readDirectory(), ReferenceCountedPointer< T >::ReferenceCountedPointer(), RocCurve::reset(), PreJackknife::runImplementation(), SamplerImpl::SamplerImpl(), Csm::SamplerToMatrix(), AlgorithmFactory::searchDefaultDirs(), SamplerImpl::setConfiguration(), ConfusionMatrix::setLowestTrainingThreshold(), OpenModeller::setModelConfiguration(), OpenModeller::setProjectionConfiguration(), ReferenceCountedPointer< T >::takePointer(), AlgorithmImpl::~AlgorithmImpl(), AlgorithmFactory::DLL::~DLL(), ReferenceCountedPointer< T >::~ReferenceCountedPointer(), and SamplerImpl::~SamplerImpl().
void Log::error | ( | const char * | format, |
... | |||
) |
'Error' level.
Definition at line 290 of file Log.cpp.
References _level, _pref, callback, Error, and FormatAndWrite().
Referenced by EnvironmentalDistance::_calc_covariance_matrix(), AquaMaps::_getAndCheckParameter(), RocCurve::_loadPredictions(), TapirOccurrences::_parseCapabilities(), GbifOccurrences::_parseServiceInfo(), GbifOccurrences::_retrieveRecords(), TapirOccurrences::_retrieveRecords(), ConsensusAlgorithm::_setAlgorithm(), RequestFile::_setAlgorithm(), ConsensusAlgorithm::_setConfiguration(), EnvironmentalDistance::_setConfiguration(), Garp::_setConfiguration(), AquaMaps::_setConfiguration(), RequestFile::_setEnvironment(), RequestFile::_setOccurrences(), RequestFile::_setProjection(), AlgorithmFactory::algorithmMetadata(), PreAlgorithm::apply(), PreJackknifeFactory::build(), PreChiSquareFactory::build(), CacheManager::cache(), OpenModeller::calculateModelStatistics(), PreJackknife::checkParameters(), PreChiSquare::checkParameters(), GdalRaster::create(), OpenModeller::createMap(), AlgorithmImpl::createModel(), OpenModeller::createModel(), TerralibRaster::createRaster(), TerralibRaster::createTeRaster(), TerralibRaster::deleteRaster(), GarpRule::evaluate(), GdalRaster::finish(), SamplerImpl::generateRandomSample(), AlgorithmImpl::getFreshCopy(), PreAlgorithm::getLayerResult(), MapFormat::getNoDataValue(), SamplerImpl::getOneSample(), RequestFile::getPresences(), MapFormat::getProjection(), SamplerImpl::getPseudoAbsence(), SamplerImpl::getPseudoAbsenceOutsideInterval(), SamplerImpl::getPseudoPresence(), SamplerImpl::getPseudoPresenceInsideInterval(), EnvironmentImpl::getRandom(), MapFormat::getXCel(), MapFormat::getXMax(), MapFormat::getXMin(), MapFormat::getYCel(), MapFormat::getYMax(), MapFormat::getYMin(), PreChiSquare::init(), EnvironmentalDistance::initialize(), GarpAlgorithm::initialize(), MinimumDistance::initialize(), SvmAlgorithm::initialize(), Bioclim::initialize(), ConsensusAlgorithm::initialize(), EnvelopeScore::initialize(), RfAlgorithm::initialize(), NNAlgorithm::initialize(), BestSubsets::initialize(), NicheMosaic::initialize(), Garp::initialize(), AbstractBestSubsets::initialize(), AquaMaps::initialize(), isFromRejectedSource(), SvmAlgorithm::iterate(), DelimitedTextOccurrences::load(), TeOccurrences::load(), GbifOccurrences::load(), TapirOccurrences::load(), main(), PreFactory< T, Arg >::make(), RequestFile::makeModel(), RequestFile::makeProjection(), AbstractBestSubsets::needNormalization(), SamplerImpl::normalize(), GdalRaster::open(), TerralibRaster::openTeRaster(), PreAlgorithm::operator=(), PreAlgorithm::reset(), PreJackknife::runImplementation(), Garp::select(), OpenModeller::setAlgorithm(), AlgorithmImpl::setConfiguration(), SamplerImpl::setConfiguration(), NicheMosaic::setMinMaxDelta(), PreChiSquare::setNlayers(), MCNode< ObjectT, PreMultiContainerKeyT >::setObjPtr(), OpenModeller::setOccurrences(), OpenModeller::setProjectionConfiguration(), DgGarpBestSubsets::transferParametersToAlgorithm(), GarpBestSubsets::transferParametersToAlgorithm(), and GdalRaster::write().
|
static |
General function that can be used to generate formatted strings
Definition at line 142 of file Log.cpp.
Referenced by Projector::createMap().
|
private |
Definition at line 120 of file Log.cpp.
References LevelLabels.
Referenced by debug(), error(), info(), operator()(), and warn().
void Log::info | ( | const char * | format, |
... | |||
) |
'Info' level.
Definition at line 256 of file Log.cpp.
References _level, _pref, callback, FormatAndWrite(), and Info.
Referenced by AquaMaps::_calculateEnvelopes(), EnvironmentalDistance::_init_distance_type(), RocCurve::_loadPredictions(), AquaMaps::_logEnvelope(), AquaMaps::_readSpeciesData(), GbifOccurrences::_retrieveRecords(), TapirOccurrences::_retrieveRecords(), RequestFile::_setEnvironment(), RequestFile::_setOccurrences(), RequestFile::_setProjection(), RocCurve::calculate(), AbstractBestSubsets::calculateBestSubset(), BestSubsets::calculateBestSubset(), OpenModeller::calculateModelStatistics(), Projector::createMap(), OpenModeller::createMap(), AlgorithmImpl::createModel(), OpenModeller::createModel(), VirtualNicheGenerator::dump(), Sample::dump(), OccurrenceImpl::dump(), OccurrencesImpl::dump(), SamplerImpl::environmentallyUnique(), errorHandler(), RocCurve::getPartialAreaRatio(), GbifOccurrences::getPresences(), TapirOccurrences::getPresences(), VirtualNicheGenerator::initialize(), SvmAlgorithm::initialize(), Bioclim::initialize(), DistanceToAverage::initialize(), EnvelopeScore::initialize(), AquaMaps::initialize(), VirtualNicheGenerator::iterate(), NNAlgorithm::iterate(), AquaMaps::iterate(), SerializedXmlOccurrences::load(), GbifOccurrences::load(), TapirOccurrences::load(), LogitRule::log(), NegatedRangeRule::log(), RangeRule::log(), GarpRule::log(), GarpRuleSet::log(), Bioclim::logEnvelope(), EnvelopeScore::logEnvelope(), main(), RequestFile::makeModel(), mapCallback(), modelCallback(), AbstractBestSubsets::needNormalization(), Header::printHeader(), PreJackknife::runImplementation(), BestSubsets::sortRuns(), SamplerImpl::spatiallyUnique(), and DistanceToAverage::~DistanceToAverage().
|
static |
Returns the instance pointer, creating the object on the first call.
Definition at line 45 of file Log.cpp.
References Log(), and mpInstance.
Referenced by EnvironmentalDistance::_calc_covariance_matrix(), AquaMaps::_calculateEnvelopes(), RocCurve::_calculateGraphPoints(), AquaMaps::_getAndCheckParameter(), EnvironmentalDistance::_init_distance_type(), RocCurve::_loadPredictions(), AquaMaps::_logEnvelope(), TapirOccurrences::_parseCapabilities(), GbifOccurrences::_parseServiceInfo(), AquaMaps::_readSpeciesData(), GbifOccurrences::_retrieveRecords(), TapirOccurrences::_retrieveRecords(), ConsensusAlgorithm::_setAlgorithm(), RequestFile::_setAlgorithm(), ConsensusAlgorithm::_setConfiguration(), EnvironmentalDistance::_setConfiguration(), Garp::_setConfiguration(), AquaMaps::_setConfiguration(), RequestFile::_setEnvironment(), RequestFile::_setOccurrences(), RequestFile::_setProjection(), AlgorithmImpl::AlgorithmImpl(), AlgorithmFactory::algorithmMetadata(), PreAlgorithm::apply(), PreChiSquareFactory::build(), PreJackknifeFactory::build(), CacheManager::cache(), EnvironmentImpl::calcRegion(), RocCurve::calculate(), ConfusionMatrix::calculate(), AbstractBestSubsets::calculateBestSubset(), BestSubsets::calculateBestSubset(), OpenModeller::calculateModelStatistics(), Csm::center(), EnvironmentImpl::checkCoordinates(), PreJackknife::checkParameters(), PreChiSquare::checkParameters(), ScaleNormalizer::computeNormalization(), MapFormat::copyDefaults(), OccurrencesFactory::create(), GdalRaster::create(), Projector::createMap(), OpenModeller::createMap(), AlgorithmImpl::createModel(), OpenModeller::createModel(), TerralibRaster::createRaster(), TerralibRaster::createTeRaster(), Csm::csm1(), RemoteRaster::deleteRaster(), WcsProxyRaster::deleteRaster(), TerralibRaster::deleteRaster(), CsmBS::discardComponents(), NNAlgorithm::done(), VirtualNicheGenerator::dump(), Sample::dump(), OccurrenceImpl::dump(), OccurrencesImpl::dump(), SamplerImpl::environmentallyUnique(), errorHandler(), GarpRule::evaluate(), WcsProxyRaster::finish(), RemoteRaster::finish(), GdalRaster::finish(), SamplerImpl::generateRandomSample(), AlgorithmImpl::getFreshCopy(), PreAlgorithm::getLayerResult(), MapFormat::getNoDataValue(), SamplerImpl::getOneSample(), RocCurve::getPartialAreaRatio(), RequestFile::getPresences(), GbifOccurrences::getPresences(), TapirOccurrences::getPresences(), MapFormat::getProjection(), SamplerImpl::getPseudoAbsence(), SamplerImpl::getPseudoAbsenceOutsideInterval(), SamplerImpl::getPseudoPresence(), SamplerImpl::getPseudoPresenceInsideInterval(), EnvironmentImpl::getRandom(), EnvironmentImpl::getUnnormalizedInternal(), Csm::getValue(), MapFormat::getXCel(), MapFormat::getXMax(), MapFormat::getXMin(), MapFormat::getYCel(), MapFormat::getYMax(), MapFormat::getYMin(), PreChiSquare::init(), EnvironmentalDistance::initialize(), VirtualNicheGenerator::initialize(), GarpAlgorithm::initialize(), SvmAlgorithm::initialize(), MinimumDistance::initialize(), DistanceToAverage::initialize(), Bioclim::initialize(), ConsensusAlgorithm::initialize(), RfAlgorithm::initialize(), EnvelopeScore::initialize(), AlgorithmRun::initialize(), CsmBS::initialize(), CacheManager::initialize(), NNAlgorithm::initialize(), BestSubsets::initialize(), NicheMosaic::initialize(), Garp::initialize(), AbstractBestSubsets::initialize(), AquaMaps::initialize(), Csm::initialize(), initialPluginPath(), initRandom(), isFromRejectedSource(), VirtualNicheGenerator::iterate(), SvmAlgorithm::iterate(), NNAlgorithm::iterate(), BestSubsets::iterate(), AquaMaps::iterate(), SerializedXmlOccurrences::load(), DelimitedTextOccurrences::load(), TeOccurrences::load(), GbifOccurrences::load(), TapirOccurrences::load(), Settings::loadConfig(), LogitRule::log(), NegatedRangeRule::log(), RangeRule::log(), GarpRule::log(), GarpRuleSet::log(), Bioclim::logEnvelope(), EnvelopeScore::logEnvelope(), main(), PreFactory< T, Arg >::make(), RequestFile::makeModel(), RequestFile::makeProjection(), mapCallback(), modelCallback(), AbstractBestSubsets::needNormalization(), AlgorithmFactory::newAlgorithm(), SamplerImpl::normalize(), GdalRaster::open(), TerralibRaster::openTeRaster(), ReferenceCountedPointer< T >::operator=(), PreAlgorithm::operator=(), AlgorithmFactory::p_addDir(), AlgorithmFactory::p_addDll(), Header::printHeader(), RemoteRaster::put(), GdalRaster::put(), WcsProxyRaster::put(), readDirectory(), ReferenceCountedPointer< T >::ReferenceCountedPointer(), PreAlgorithm::reset(), RocCurve::reset(), PreJackknife::runImplementation(), SamplerImpl::SamplerImpl(), Csm::SamplerToMatrix(), AlgorithmFactory::searchDefaultDirs(), Garp::select(), OpenModeller::setAlgorithm(), AlgorithmImpl::setConfiguration(), OccurrencesImpl::setConfiguration(), SamplerImpl::setConfiguration(), OccurrencesImpl::setEnvironment(), MapFormat::setFormat(), OpenModeller::setLogLevel(), ConfusionMatrix::setLowestTrainingThreshold(), NicheMosaic::setMinMaxDelta(), OpenModeller::setModelConfiguration(), PreChiSquare::setNlayers(), MCNode< ObjectT, PreMultiContainerKeyT >::setObjPtr(), OpenModeller::setOccurrences(), OpenModeller::setProjectionConfiguration(), BestSubsets::sortRuns(), SamplerImpl::spatiallyUnique(), ReferenceCountedPointer< T >::takePointer(), DgGarpBestSubsets::transferParametersToAlgorithm(), GarpBestSubsets::transferParametersToAlgorithm(), GdalRaster::write(), AlgorithmImpl::~AlgorithmImpl(), DistanceToAverage::~DistanceToAverage(), AlgorithmFactory::DLL::~DLL(), ReferenceCountedPointer< T >::~ReferenceCountedPointer(), and SamplerImpl::~SamplerImpl().
void Log::operator() | ( | const char * | format, |
... | |||
) |
void Log::set | ( | Log::Level | level, |
std::string | fileName, | ||
char const * | pref = "" |
||
) |
Configure the logger.
Definition at line 196 of file Log.cpp.
References _deleteCallback, setCallback(), setLevel(), and setPrefix().
Referenced by main().
void Log::setCallback | ( | LogCallback * | lc | ) |
|
inline |
Change log level.
Definition at line 107 of file Log.hh.
Referenced by main(), set(), and OpenModeller::setLogLevel().
void Log::setPrefix | ( | const char * | pref | ) |
void Log::warn | ( | const char * | format, |
... | |||
) |
'Warn' level.
Definition at line 273 of file Log.cpp.
References _level, _pref, callback, FormatAndWrite(), and Warn.
Referenced by RocCurve::_loadPredictions(), AquaMaps::_readSpeciesData(), RequestFile::_setAlgorithm(), RequestFile::_setEnvironment(), RequestFile::_setOccurrences(), RequestFile::_setProjection(), EnvironmentImpl::calcRegion(), ConfusionMatrix::calculate(), ScaleNormalizer::computeNormalization(), GdalRaster::create(), Projector::createMap(), OpenModeller::createMap(), TerralibRaster::createRaster(), Csm::csm1(), WcsProxyRaster::deleteRaster(), RemoteRaster::deleteRaster(), WcsProxyRaster::finish(), RemoteRaster::finish(), GdalRaster::finish(), Csm::getValue(), EnvironmentalDistance::initialize(), VirtualNicheGenerator::initialize(), Bioclim::initialize(), SvmAlgorithm::initialize(), MinimumDistance::initialize(), RfAlgorithm::initialize(), CsmBS::initialize(), NNAlgorithm::initialize(), BestSubsets::initialize(), NicheMosaic::initialize(), AbstractBestSubsets::initialize(), Csm::initialize(), NNAlgorithm::iterate(), TapirOccurrences::load(), main(), RequestFile::makeModel(), GdalRaster::open(), AlgorithmFactory::p_addDir(), RemoteRaster::put(), GdalRaster::put(), WcsProxyRaster::put(), OpenModeller::setAlgorithm(), OccurrencesImpl::setConfiguration(), OccurrencesImpl::setEnvironment(), MapFormat::setFormat(), and ConfusionMatrix::setLowestTrainingThreshold().
|
private |
|
private |
|
private |
Definition at line 131 of file Log.hh.
Referenced by debug(), error(), info(), operator()(), setPrefix(), and warn().
|
private |
Definition at line 127 of file Log.hh.
Referenced by debug(), error(), info(), operator()(), setCallback(), warn(), and ~Log().
|
staticprivate |
Definition at line 125 of file Log.hh.
Referenced by instance().