]> git.lyx.org Git - lyx.git/blobdiff - src/support/debug.cpp
there is no trunk/src/intl folder
[lyx.git] / src / support / debug.cpp
index a20e06b41593e56a2cdbdd05932763bc5f994f06..82f0732c445bf10aafaaba5b2835306f60926063 100644 (file)
 
 #include <config.h>
 
-#include "support/debug.h"
-
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/FileName.h"
 
+#include <boost/assert.hpp>
+
 #include <iostream>
 #include <iomanip>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::ascii_lowercase;
-using support::bformat;
-using support::isStrInt;
-
 namespace {
 
 struct ErrorItem {
@@ -65,6 +63,9 @@ ErrorItem errorTags[] = {
        { Debug::CHANGES,   "changes",   N_("Change tracking")},
        { Debug::EXTERNAL,  "external",  N_("External template/inset messages")},
        { Debug::PAINTING,  "painting",  N_("RowPainter profiling")},
+       { Debug::SCROLLING, "scrolling", N_("scrolling debugging")},
+       { Debug::MACROS,    "macros",    N_("Math macros")},
+       { Debug::RTL,       "rtl",       N_("RTL/Bidi")},
        { Debug::DEBUG,     "debug",     N_("Developers' general debug messages")},
        { Debug::ANY,       "any",       N_("All debugging messages")}
 };
@@ -171,20 +172,26 @@ LyXErr & operator<<(LyXErr & l, unsigned long t)
 { if (l.enabled()) l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, double t)
 { if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::string const & t)
+LyXErr & operator<<(LyXErr & l, string const & t)
 { if (l.enabled()) l.stream() << t; return l; }
 LyXErr & operator<<(LyXErr & l, docstring const & t)
 { if (l.enabled()) l.stream() << to_utf8(t); return l; }
-LyXErr & operator<<(LyXErr & l, support::FileName const & t)
+LyXErr & operator<<(LyXErr & l, FileName const & t)
 { if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
+LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
 { if (l.enabled()) l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ios_base &(*t)(std::ios_base &))
+LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
 { if (l.enabled()) l.stream() << t; return l; }
 
 
 // The global instance
 LyXErr lyxerr;
 
+void doAssert(char const * expr,  char const * file, long line)
+{
+       LYXERR0("ASSERTION " << expr << " VIOLATED in " << file << ":" << line);
+       // comment this out if not needed
+       BOOST_ASSERT(false);
+}
 
 } // namespace lyx