예제 #1
0
파일: log.cpp 프로젝트: MakSim345/cpp
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;
}
예제 #3
0
파일: log.cpp 프로젝트: MakSim345/cpp
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;
        }
    }
}
예제 #4
0
파일: log.cpp 프로젝트: MakSim345/cpp
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));
}
예제 #5
0
파일: log.cpp 프로젝트: MakSim345/cpp
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");
    }
}