]> git.lyx.org Git - lyx.git/blob - src/tracer.h
365cfa53dd5e3a7f00007d17b52d9fd3aa5736a0
[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 class DebugTracer {
9 public:
10         DebugTracer(string const & s) : str(s) {
11                 lyxerr << string(depth, ' ') << "Trace begin : "
12                        << str << std::endl;
13                 ++depth;
14                 
15         }
16         ~DebugTracer() {
17                 --depth;
18                 lyxerr << string(depth, ' ') << "Trace end : "
19                        << str << std::endl;
20         }
21 private:
22         string str;
23         static int depth;
24 };
25
26 #endif