summaryrefslogtreecommitdiffstats
path: root/src/message.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-10-15 15:32:16 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-10-15 15:32:16 (GMT)
commit868208ab61ca3aa6f506076f60de2745eaa8a6be (patch)
tree7824ba2a5c9f1fe6ddc8633a13cc7d1e7a6c79a3 /src/message.cpp
parent499475795ed160e3a1e9cb571adc1ad86dc6a8ba (diff)
downloadDoxygen-868208ab61ca3aa6f506076f60de2745eaa8a6be.zip
Doxygen-868208ab61ca3aa6f506076f60de2745eaa8a6be.tar.gz
Doxygen-868208ab61ca3aa6f506076f60de2745eaa8a6be.tar.bz2
Release-1.2.2-20001015
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 9554c02..112d5af 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -28,6 +28,8 @@ static int warnFormatOrder; // 1 = $file,$line,$text
// 5 = $text,$file,$line
// 6 = $line,$file,$text
+static FILE *warnFile = stderr;
+
void initWarningFormat()
{
int filePos = Config::warnFormat.find("$file");
@@ -78,6 +80,11 @@ void initWarningFormat()
// replace(QRegExp("\\$text"),"%s").
// replace(QRegExp("\\$line"),"%d")+
// '\n';
+
+ if (!Config::warnLogFile.isEmpty())
+ {
+ warnFile = fopen(Config::warnLogFile,"w");
+ }
}
@@ -104,12 +111,12 @@ void warn(const char *file,int line,const char *fmt, ...)
va_end(args);
switch(warnFormatOrder)
{
- case 1: fprintf(stderr,outputFormat,file,line,text); break;
- case 2: fprintf(stderr,outputFormat,text,line,file); break;
- case 3: fprintf(stderr,outputFormat,line,text,file); break;
- case 4: fprintf(stderr,outputFormat,file,text,line); break;
- case 5: fprintf(stderr,outputFormat,text,file,line); break;
- case 6: fprintf(stderr,outputFormat,line,file,text); break;
+ case 1: fprintf(warnFile,outputFormat,file,line,text); break;
+ case 2: fprintf(warnFile,outputFormat,text,line,file); break;
+ case 3: fprintf(warnFile,outputFormat,line,text,file); break;
+ case 4: fprintf(warnFile,outputFormat,file,text,line); break;
+ case 5: fprintf(warnFile,outputFormat,text,file,line); break;
+ case 6: fprintf(warnFile,outputFormat,line,file,text); break;
default:
printf("Error: warning format has not been initialized!\n");
}
@@ -122,7 +129,7 @@ void warn_cont(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(stderr, fmt, args);
+ vfprintf(warnFile, fmt, args);
va_end(args);
}
}
@@ -139,12 +146,12 @@ void warn_undoc(const char *file,int line,const char *fmt, ...)
va_end(args);
switch(warnFormatOrder)
{
- case 1: fprintf(stderr,outputFormat,file,line,text); break;
- case 2: fprintf(stderr,outputFormat,text,line,file); break;
- case 3: fprintf(stderr,outputFormat,line,text,file); break;
- case 4: fprintf(stderr,outputFormat,file,text,line); break;
- case 5: fprintf(stderr,outputFormat,text,file,line); break;
- case 6: fprintf(stderr,outputFormat,line,file,text); break;
+ case 1: fprintf(warnFile,outputFormat,file,line,text); break;
+ case 2: fprintf(warnFile,outputFormat,text,line,file); break;
+ case 3: fprintf(warnFile,outputFormat,line,text,file); break;
+ case 4: fprintf(warnFile,outputFormat,file,text,line); break;
+ case 5: fprintf(warnFile,outputFormat,text,file,line); break;
+ case 6: fprintf(warnFile,outputFormat,line,file,text); break;
default:
printf("Error: warning format has not been initialized!\n");
}
@@ -155,6 +162,6 @@ void err(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(stderr, fmt, args);
+ vfprintf(warnFile, fmt, args);
va_end(args);
}