Logger::Logger(const CString& cszName, LoggerPtr spParent) :m_enLevel(none), m_bAdditivity(true), m_spParent(spParent), m_cszName(cszName) { // construct a root logger? if (spParent.get() == NULL) { m_enLevel = debug; m_bAdditivity = false; } }
Log::Level Logger::GetLoggerLevel() { Log::Level enLoggerLevel = m_enLevel; if (enLoggerLevel == none) { LoggerPtr spParent = m_spParent; do { ATLASSERT(spParent.get() != NULL); enLoggerLevel = spParent->Level(); spParent = spParent->Parent(); } while(enLoggerLevel == none); } return enLoggerLevel; }