summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-03-30 00:40:20 -0300
committershennetsind <ind@henn.et>2013-03-30 00:40:20 -0300
commit87373047cd4aaf8b0c2425133b9b907e3ea4d122 (patch)
treea9691c2ed1aaeddacb905fb2506bd6a3f3e8c140 /src
parenta89d501fc60b12a997a262429cb4515af9dad69e (diff)
downloadhercules-87373047cd4aaf8b0c2425133b9b907e3ea4d122.tar.gz
hercules-87373047cd4aaf8b0c2425133b9b907e3ea4d122.tar.bz2
hercules-87373047cd4aaf8b0c2425133b9b907e3ea4d122.tar.xz
hercules-87373047cd4aaf8b0c2425133b9b907e3ea4d122.zip
Modified memory manager log
Now supporting hybrid tracking, git and/or svn revision Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/common/malloc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 9976a28d5..eb073036e 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#include "../common/malloc.h"
#include "../common/core.h"
@@ -530,18 +531,20 @@ static FILE *log_fp;
static void memmgr_log (char *buf)
{
- if( !log_fp )
- {
+ if( !log_fp ) {
time_t raw;
struct tm* t;
+ const char* svn = get_svn_revision();
+ const char* git = get_git_hash();
log_fp = fopen(memmer_logfile,"at");
if (!log_fp) log_fp = stdout;
time(&raw);
t = localtime(&raw);
- fprintf(log_fp, "\nMemory manager: Memory leaks found at %d/%02d/%02d %02dh%02dm%02ds (Revision %s).\n",
- (t->tm_year+1900), (t->tm_mon+1), t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, get_svn_revision());
+ fprintf(log_fp, "\nMemory manager: Memory leaks found at %d/%02d/%02d %02dh%02dm%02ds (rev %s).\n",
+ (t->tm_year+1900), (t->tm_mon+1), t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec,
+ git[0] != HERC_UNKNOWN_VER ? git : svn[0] != HERC_UNKNOWN_VER ? svn : "Unknown");
}
fprintf(log_fp, "%s", buf);
return;