]> git.lyx.org Git - features.git/blob - src/error.C
last updates from 1.0.4, no more updates expected from that branch now
[features.git] / src / error.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "error.h"
8 #include <stdio.h>
9
10 //      $Id: error.C,v 1.1 1999/09/27 18:44:37 larsbj Exp $     
11
12 #if !defined(lint) && !defined(WITH_WARNINGS)
13 static char vcid[] = "$Id: error.C,v 1.1 1999/09/27 18:44:37 larsbj Exp $";
14 #endif /* lint */
15
16 Error::Error(int level) // should loglevel also be an argument?
17 {
18         debuglevel = level;
19         loglevel = 0;
20 }
21
22
23 void Error::setDebugLevel(int level)
24 {
25         debuglevel = level;
26 }
27
28
29 void Error::debug(LString const & msg, int level)
30 {
31         if (debuglevel & level)
32                 print(msg);
33         // should also print to the logfile
34 }
35
36 void Error::print(LString const & msg)
37 {
38         if (!msg.empty()) 
39                 fprintf(stderr, "%s\n", msg.c_str());
40 }
41
42