From 3137a0a38d658790dccd4cedb45af0977185d9dc Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 17 Jan 2010 18:20:22 +0000 Subject: Support strftime format characters in blocks git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12280 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/logger.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/logger.cpp') diff --git a/src/logger.cpp b/src/logger.cpp index d3dfc1224..8c9d9a79b 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -94,7 +94,11 @@ void LogManager::OpenFileLogs() std::map::iterator fwi = logmap.find(target); if (fwi == logmap.end()) { - FILE* f = fopen(target.c_str(), "a"); + char realtarget[MAXBUF]; + time_t time = ServerInstance->Time(); + struct tm *mytime = gmtime(&time); + strftime(realtarget, MAXBUF, target.c_str(), mytime); + FILE* f = fopen(realtarget, "a"); fw = new FileWriter(f); logmap.insert(std::make_pair(target, fw)); } -- cgit v1.2.3