summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-17 18:20:22 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-17 18:20:22 +0000
commit3137a0a38d658790dccd4cedb45af0977185d9dc (patch)
treeb2ca4a5d159a4af71d5e6102158b0f0c8f38186c /src
parent5d474dc9fbd9bd36d0a0a8df93e1ec1e180864d7 (diff)
Support strftime format characters in <log> blocks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12280 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/logger.cpp6
1 files changed, 5 insertions, 1 deletions
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<std::string, FileWriter*>::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));
}