From 93698f0d61935f86019b3491c9e62c6326a180ba Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 2 Oct 2012 05:18:42 -0400 Subject: Added operserv/logsearch --- src/logger.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/logger.cpp') diff --git a/src/logger.cpp b/src/logger.cpp index 6547e3e6b..6a5e1594b 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -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) -- cgit