void LogComponentEnableAll (enum LogLevel level) { ComponentList *components = GetComponentList (); for (ComponentListI i = components->begin (); i != components->end (); i++) { i->second->Enable (level); } }
const char* GetComponentXML() { xmlDocument.reset(); GetComponentList(xmlDocument); std::stringstream ss; xmlDocument.save(ss); char *p = new char[ss.str().size()+1]; strcpy(p, ss.str().c_str()); return p; }
void LogComponentDisable (char const *name, enum LogLevel level) { ComponentList *components = GetComponentList (); for (ComponentListI i = components->begin (); i != components->end (); i++) { if (i->first.compare (name) == 0) { i->second->Disable (level); break; } } }
LogComponent::LogComponent (char const * name) : m_levels (0), m_name (name) { //EnvVarCheck (name); ComponentList *components = GetComponentList (); for (ComponentListI i = components->begin (); i != components->end (); i++) { if (i->first == name) { std::cerr << "Log component \""<<name<<"\" has already been registered once." << std::endl; } } components->push_back (std::make_pair (name, this)); }
void LogComponentEnable (char const *name, enum LogLevel level) { ComponentList *components = GetComponentList (); ComponentListI i; for (i = components->begin (); i != components->end (); i++) { if (i->first.compare (name) == 0) { i->second->Enable (level); return; } } if (i == components->end()) { // nothing matched LogComponentPrintList(); NS_FATAL_ERROR ("Logging component \"" << name << "\" not found. See above for a list of available log components"); } }