diff options
author | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-22 16:31:05 +0000 |
---|---|---|
committer | mc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-22 16:31:05 +0000 |
commit | 260f3c8f931a55b334b7903475a667406f69cce2 (patch) | |
tree | 157131e868296b8f99c99515da86bc5b34527f3d /src/common/showmsg.c | |
parent | 5612f822c84f6c6adde97b2676d1bab6658ef4c0 (diff) | |
download | hercules-260f3c8f931a55b334b7903475a667406f69cce2.tar.gz hercules-260f3c8f931a55b334b7903475a667406f69cce2.tar.bz2 hercules-260f3c8f931a55b334b7903475a667406f69cce2.tar.xz hercules-260f3c8f931a55b334b7903475a667406f69cce2.zip |
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@732 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r-- | src/common/showmsg.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 8c7fc9a13..3488926bf 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -35,8 +35,9 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri case MSG_WARNING: //Bright Yellow strcpy(prefix,CL_YELLOW"[Warning]"CL_RESET":"); break; - case MSG_DEBUG: + case MSG_DEBUG: //Bright Cyan, important stuff! strcpy(prefix,CL_CYAN"[Debug]"CL_RESET":"); + break; case MSG_ERROR: //Bright Red (Regular errors) strcpy(prefix,CL_RED"[Error]"CL_RESET":"); break; @@ -47,16 +48,20 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri ShowError("In function _ShowMessage() -> Invalid flag passed.\n"); return 1; } + if (!(flag == MSG_DEBUG && !SHOW_DEBUG_MSG)) { output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // +2: space and a \0 if (output == NULL) { return 1; // exit(1); // Kill server? Deadly } + strcpy(output,prefix); strcat(output," "); strcat(output,string); printf(output); fflush(stdout); + free(output); + } /* if ((core_config.debug_output_level > -1) && (flag >= core_config.debug_output_level)) { FILE *fp; |