From 87373047cd4aaf8b0c2425133b9b907e3ea4d122 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 30 Mar 2013 00:40:20 -0300 Subject: Modified memory manager log Now supporting hybrid tracking, git and/or svn revision Signed-off-by: shennetsind --- src/common/malloc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/common/malloc.c') 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; -- cgit v1.2.3-60-g2f50