File: debug.h

package info (click to toggle)
sms-pl 1.9.2m-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 620 kB
  • ctags: 355
  • sloc: cpp: 2,143; ansic: 1,046; perl: 272; makefile: 113; sh: 97
file content (34 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __debug_h
#define __debug_h

#include <fstream>
#include <string>
using namespace std;

#define LOG_FILE "sms.log"
#define MAX_LOG_LINE_LEN 32768

#define LOG_INFO 1
#define LOG_WARN 2

class Debug
{
      ofstream str;
      string name;

      void Open();
public:
      Debug(const string &file) : name(file) {};

      void Log(int level, const char *msg, ...);
};

class Exception
{
      string what;
public:
      Exception(const string &str) : what(str) {};
      const string &Info() const { return what; };
};

#endif