#include "inspircd.h"
-#include "filelogger.h"
/*
* Suggested implementation...
*/
const char LogStream::LogHeader[] =
- "Log started for " VERSION " (" REVISION ", " MODULE_INIT_STR ")"
- " - compiled on " SYSTEM;
+ "Log started for " INSPIRCD_VERSION " (" INSPIRCD_REVISION ", " MODULE_INIT_STR ")"
+ " - compiled on " INSPIRCD_SYSTEM;
LogManager::LogManager()
: Logging(false)
loglevel = LOG_NONE;
}
FileWriter* fw;
- std::string target = tag->getString("target");
+ std::string target = ServerInstance->Config->Paths.PrependLog(tag->getString("target"));
std::map<std::string, FileWriter*>::iterator fwi = logmap.find(target);
if (fwi == logmap.end())
{
{
for (std::map<std::string, std::vector<LogStream*> >::iterator i = LogStreams.begin(); i != LogStreams.end(); ++i)
{
- std::vector<LogStream*>::iterator it;
- while ((it = std::find(i->second.begin(), i->second.end(), l)) != i->second.end())
+ while (stdalgo::erase(i->second, l))
{
- i->second.erase(it);
+ // Keep erasing while it exists
}
}
if (i != LogStreams.end())
{
- std::vector<LogStream *>::iterator it = std::find(i->second.begin(), i->second.end(), l);
-
- if (it != i->second.end())
+ if (stdalgo::erase(i->second, l))
{
- i->second.erase(it);
if (i->second.size() == 0)
{
LogStreams.erase(i);
for (std::map<LogStream *, std::vector<std::string> >::iterator gi = GlobalLogStreams.begin(); gi != GlobalLogStreams.end(); ++gi)
{
- if (std::find(gi->second.begin(), gi->second.end(), type) != gi->second.end())
+ if (stdalgo::isin(gi->second, type))
{
continue;
}