]> git.lyx.org Git - lyx.git/blob - src/error.C
merge from the string-switch branch and ready for a prelease.
[lyx.git] / src / error.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "error.h"
8 #include <cstdio>
9
10 Error::Error(int level) // should loglevel also be an argument?
11 {
12         debuglevel = level;
13         loglevel = 0;
14 }
15
16
17 void Error::setDebugLevel(int level)
18 {
19         debuglevel = level;
20 }
21
22
23 void Error::debug(string const & msg, int level)
24 {
25         if (debuglevel & level)
26                 print(msg);
27         // should also print to the logfile
28 }
29
30 void Error::print(string const & msg)
31 {
32         if (!msg.empty()) 
33                 fprintf(stderr, "%s\n", msg.c_str());
34 }
35
36