summaryrefslogtreecommitdiff
path: root/src/common/showmsg.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 14:19:26 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 14:19:26 +0000
commit3adaf8788b65a84ec4266c6621d30679a95f546d (patch)
treeda233eb45db1f482a4f2a86be9529c90edd76c8b /src/common/showmsg.c
parentad95c2ba955e42d74afffbb6b9b333f69a3f1b1e (diff)
downloadhercules-3adaf8788b65a84ec4266c6621d30679a95f546d.tar.gz
hercules-3adaf8788b65a84ec4266c6621d30679a95f546d.tar.bz2
hercules-3adaf8788b65a84ec4266c6621d30679a95f546d.tar.xz
hercules-3adaf8788b65a84ec4266c6621d30679a95f546d.zip
Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, generated by ShowMessage(). It now works exactly like printf().
Removed/replaced all printf calls in the code. Added a new flag to setting 'console_silent', for filtering debug messages. Silenced the "Broken pipe found" and "Server running in debug mode" messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r--src/common/showmsg.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index fa744f0e4..c50716bed 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -525,9 +525,6 @@ int FPRINTF(HANDLE handle, const char *fmt, ...)
#else // not _WIN32
-//#define VPRINTF vprintf
-//#define PRINTF printf
-
#define is_console(file) (0!=isatty(fileno(file)))
//vprintf_without_ansiformats
@@ -674,12 +671,8 @@ int FPRINTF(FILE *file, const char *fmt, ...)
char timestamp_format[20] = ""; //For displaying Timestamps
-// by MC Cameri
int _vShowMessage(enum msg_type flag, const char *string, va_list ap)
{
- // _ShowMessage MUST be used instead of printf as of 10/24/2004.
- // Return: 0 = Successful, 1 = Failed.
-// int ret = 0;
char prefix[100];
#if defined(DEBUGLOGMAP) || defined(DEBUGLOGCHAR) || defined(DEBUGLOGLOGIN)
FILE *fp;
@@ -689,19 +682,18 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap)
ShowError("Empty string passed to _vShowMessage().\n");
return 1;
}
- if (
-#if !defined(SHOW_DEBUG_MSG)
- (flag == MSG_DEBUG) ||
-#endif
+ if(
(flag == MSG_INFORMATION && msg_silent&1) ||
(flag == MSG_STATUS && msg_silent&2) ||
(flag == MSG_NOTICE && msg_silent&4) ||
(flag == MSG_WARNING && msg_silent&8) ||
(flag == MSG_ERROR && msg_silent&16) ||
- (flag == MSG_SQL && msg_silent&16))
+ (flag == MSG_SQL && msg_silent&16) ||
+ (flag == MSG_DEBUG && msg_silent&32)
+ )
return 0; //Do not print it.
- if (timestamp_format[0])
+ if (timestamp_format[0] && flag != MSG_NONE)
{ //Display time format. [Skotlex]
time_t t = time(NULL);
strftime(prefix, 80, timestamp_format, localtime(&t));