* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
* \author Jean-Marc Lasgouttes
+ * \author Pavel Sanda
*
* Full author contact details are available in file CREDITS.
*/
#include "support/strfwd.h"
-
namespace std {
class ios_base;
///
LYXSERVER = (1 << 12), // 4096
///
- ROFF = (1 << 13), // 8192
+ UNDO = (1 << 13), // 8192
///
ACTION = (1 << 14), // 16384
///
///
PAINTING = (1 << 24),
///
+ SCROLLING = (1 << 25),
+ ///
+ MACROS = (1 << 26),
+ /// rtl-related
+ RTL = (1 << 27),
+ /// locale related
+ LOCALE = (1 << 28),
+ /// selection
+ SELECTION = (1 << 29),
+ /// Find and Replace
+ FIND = (1 << 30),
+ ///
DEBUG = (1 << 31),
///
ANY = 0xffffffff
};
+
+ // Return number of levels
+ int levelCount();
+
+
/** A function to convert symbolic string names on debug levels
to their numerical value.
*/
Type value(std::string const & val);
+ /** A function to convert index of level to their numerical value.
+ */
+ Type value(int val);
+
+ /// Return description of level
+ std::string const description(Type val);
+
+ /// Return name of level
+ std::string const name(Type val);
+
+
/** Display the tags and descriptions of the current debug level
of ds
*/
class LyXErr
{
public:
+ LyXErr(): enabled_(true), second_used_(false) {}
/// Disable the stream completely
void disable();
/// Enable the stream after a possible call of disable()
void enable();
+ ///
+ bool enabled() const { return enabled_; }
/// Returns true if t is part of the current debug level.
bool debugging(Debug::Type t = Debug::ANY) const;
/// Ends output
/// Sets stream
std::ostream & stream() { return *stream_; }
/// Sets the debug level to t.
- void level(Debug::Type t) { dt = t; }
+ void setLevel(Debug::Type t) { dt = t; }
/// Returns the current debug level.
Debug::Type level() const { return dt; }
/// Returns stream
operator std::ostream &() { return *stream_; }
+ /// Returns second_used_
+ bool second_used() { return second_used_; }
+ // Returns second stream
+ std::ostream & second() { return *second_; };
+ /// Sets the second stream
+ void setSecond(std::ostream * os) { second_used_ = (second_ = os); }
+
private:
/// The current debug level
Debug::Type dt;
bool enabled_;
/// The real stream
std::ostream * stream_;
+ /// Next stream for output duplication
+ std::ostream * second_;
+ /// Is the second stream enabled?
+ bool second_used_;
};
namespace support { class FileName; }
else { lyx::lyxerr << CURRENT_POSITION << msg; lyx::lyxerr.endl(); } \
} while (0)
-#define LYXERR0(msg) LYXERR(lyx::Debug::ANY, msg)
+#define LYXERR0(msg) \
+ do { \
+ lyx::lyxerr << CURRENT_POSITION << msg; lyx::lyxerr.endl(); \
+ } while (0)
+
#endif