1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 20:23:11 +02:00

Added operserv/logsearch

This commit is contained in:
Adam
2012-10-02 05:18:42 -04:00
parent f7aa837696
commit 93698f0d61
3 changed files with 188 additions and 8 deletions
+2 -8
View File
@@ -51,21 +51,15 @@ static Anope::string GetTimeStamp()
return tbuf;
}
static Anope::string GetLogDate(time_t t = Anope::CurTime)
static inline Anope::string CreateLogName(const Anope::string &file, time_t t = Anope::CurTime)
{
char timestamp[32];
time(&t);
tm *tm = localtime(&t);
strftime(timestamp, sizeof(timestamp), "%Y%m%d", tm);
return timestamp;
}
static inline Anope::string CreateLogName(const Anope::string &file, time_t t = Anope::CurTime)
{
return log_dir + "/" + file + "." + GetLogDate(t);
return log_dir + "/" + file + "." + timestamp;
}
LogFile::LogFile(const Anope::string &name) : filename(name), stream(name.c_str(), std::ios_base::out | std::ios_base::app)