2000-03-28 02:18:55 +00:00
|
|
|
// -*- C++ -*-
|
2000-07-24 13:53:19 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-2000 The LyX Team.
|
|
|
|
*
|
|
|
|
* ====================================================== */
|
|
|
|
|
2000-03-17 10:26:26 +00:00
|
|
|
#ifndef TRACER_H
|
|
|
|
#define TRACER_H
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-03-17 10:26:26 +00:00
|
|
|
#include "debug.h"
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-03-17 10:26:26 +00:00
|
|
|
class DebugTracer {
|
|
|
|
public:
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
explicit
|
2000-03-17 10:26:26 +00:00
|
|
|
DebugTracer(string const & s) : str(s) {
|
2000-03-28 02:18:55 +00:00
|
|
|
lyxerr << string(depth, ' ') << "Trace begin : "
|
2000-04-04 00:19:15 +00:00
|
|
|
<< str << std::endl;
|
2000-03-17 10:26:26 +00:00
|
|
|
++depth;
|
|
|
|
|
|
|
|
}
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-03-17 10:26:26 +00:00
|
|
|
~DebugTracer() {
|
|
|
|
--depth;
|
2000-03-28 02:18:55 +00:00
|
|
|
lyxerr << string(depth, ' ') << "Trace end : "
|
2000-04-04 00:19:15 +00:00
|
|
|
<< str << std::endl;
|
2000-03-17 10:26:26 +00:00
|
|
|
}
|
|
|
|
private:
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-03-17 10:26:26 +00:00
|
|
|
string str;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-03-17 10:26:26 +00:00
|
|
|
static int depth;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|