MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnLogGetLoggerForMask

Function xnLogGetLoggerForMask

Source/OpenNI/XnLog.cpp:766–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766XnLogger* xnLogGetLoggerForMask(const XnChar* csLogMask, XnBool bCreate)
767{
768 XnLogger* pLogger = NULL;
769 LogData& logData = LogData::GetInstance();
770 if (XN_STATUS_OK == logData.pMasksHash->Get(csLogMask, pLogger))
771 {
772 return pLogger;
773 }
774 else if (bCreate)
775 {
776 XnLogger logger;
777 logger.nMinSeverity = logData.defaultMinSeverity;
778
779 // first of all, add it to the map
780 if (XN_STATUS_OK != logData.pMasksHash->Set(csLogMask, logger))
781 {
782 // failed to add it to the map
783 XN_ASSERT(FALSE);
784 return NULL;
785 }
786
787 // now find it in the map
788 XnLogMasksHash::Iterator it = logData.pMasksHash->Find(csLogMask);
789 if (it == logData.pMasksHash->End())
790 {
791 XN_ASSERT(FALSE);
792 return NULL;
793 }
794
795 it->Value().pInternal = (void*)it->Key();
796
797 return &it->Value();
798 }
799 else
800 {
801 return NULL;
802 }
803}
804
805void xnLogWriteNoEntryImplV(const XnChar* csFormat, va_list args)
806{

Callers 5

xnLogSetMaskMinSeverityFunction · 0.85
xnLogGetMaskMinSeverityFunction · 0.85
xnLoggerOpenFunction · 0.85
xnLogBCSetMaskStateFunction · 0.85
xnLogIsEnabledFunction · 0.85

Calls 5

GetMethod · 0.45
SetMethod · 0.45
FindMethod · 0.45
EndMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected