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:
+2
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user