| 764 | } |
| 765 | |
| 766 | XnLogger* 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 | |
| 805 | void xnLogWriteNoEntryImplV(const XnChar* csFormat, va_list args) |
| 806 | { |
no test coverage detected