2000-03-28 02:18:55 +00:00
|
|
|
// -*- C++ -*-
|
2000-03-17 10:26:26 +00:00
|
|
|
#ifndef TRACER_H
|
|
|
|
#define TRACER_H
|
|
|
|
|
|
|
|
#include "debug.h"
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-03-28 02:18:55 +00:00
|
|
|
using std::endl;
|
|
|
|
|
2000-03-17 10:26:26 +00:00
|
|
|
class DebugTracer {
|
|
|
|
public:
|
|
|
|
DebugTracer(string const & s) : str(s) {
|
2000-03-28 02:18:55 +00:00
|
|
|
lyxerr << string(depth, ' ') << "Trace begin : "
|
|
|
|
<< str << endl;
|
2000-03-17 10:26:26 +00:00
|
|
|
++depth;
|
|
|
|
|
|
|
|
}
|
|
|
|
~DebugTracer() {
|
|
|
|
--depth;
|
2000-03-28 02:18:55 +00:00
|
|
|
lyxerr << string(depth, ' ') << "Trace end : "
|
|
|
|
<< str << endl;
|
2000-03-17 10:26:26 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
string str;
|
|
|
|
static int depth;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|