From: TimePath Date: Sun, 13 Mar 2016 09:32:12 +0000 (+1100) Subject: Log: add progname prefix X-Git-Tag: xonotic-v0.8.2~1100 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=98950846b70129bb195768994fc91425065104a1;p=xonotic%2Fxonotic-data.pk3dir.git Log: add progname prefix --- diff --git a/qcsrc/lib/log.qh b/qcsrc/lib/log.qh index 01dc645f5..68c974dc3 100644 --- a/qcsrc/lib/log.qh +++ b/qcsrc/lib/log.qh @@ -1,5 +1,7 @@ #pragma once +#include "progname.qh" + #define assert(expr, ...) _assert(LOG_SEVERE, expr, __VA_ARGS__) #define devassert(...) MACRO_BEGIN if (autocvar_developer) assert(__VA_ARGS__); MACRO_END @@ -38,7 +40,7 @@ string(string...) strcat0n = #115; #define _LOG(f, level, s) \ MACRO_BEGIN { \ - f(sprintf("^9[::" level "^9] [" __FILE__ "^7:^9%s^7:^9" STR(__LINE__) "] \n^7%s\n", __FUNC__, s)); \ + f(sprintf("^9[::^7" PROGNAME "^9::" level "^9] [" __FILE__ "^7:^9%s^7:^9" STR(__LINE__) "] \n^7%s\n", __FUNC__, s)); \ } MACRO_END #define LOG_FATAL(...) _LOG_FATAL(strcat0n(__VA_ARGS__))