]> git.lyx.org Git - lyx.git/blob - src/tracer.h
bcde291ee02e525d6dddb0232d91be651922d678
[lyx.git] / src / tracer.h
1 // -*- C++ -*-
2 #ifndef TRACER_H
3 #define TRACER_H
4
5 #include "debug.h"
6 #include "LString.h"
7
8 using std::endl;
9
10 class DebugTracer {
11 public:
12         DebugTracer(string const & s) : str(s) {
13                 lyxerr << string(depth, ' ') << "Trace begin : "
14                        << str << endl;
15                 ++depth;
16                 
17         }
18         ~DebugTracer() {
19                 --depth;
20                 lyxerr << string(depth, ' ') << "Trace end : "
21                        << str << endl;
22         }
23 private:
24         string str;
25         static int depth;
26 };
27
28 #endif