]> git.lizzy.rs Git - minetest.git/blobdiff - src/debug.h
Refactor logging
[minetest.git] / src / debug.h
index 2ccbe58bac9670f86d005d3ef24145b3e8553e1e..b7521fec28cdcfc900d2a5649b4beb80a01936ec 100644 (file)
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <exception>
 #include <assert.h>
 #include "gettime.h"
+#include "log.h"
 
 #if (defined(WIN32) || defined(_WIN32_WCE))
        #define WIN32_LEAN_AND_MEAN
@@ -36,9 +37,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        #endif
        #define __NORETURN __declspec(noreturn)
        #define __FUNCTION_NAME __FUNCTION__
+       #define NORETURN __declspec(noreturn)
+       #define FUNCTION_NAME __FUNCTION__
 #else
        #define __NORETURN __attribute__ ((__noreturn__))
        #define __FUNCTION_NAME __PRETTY_FUNCTION__
+       #define NORETURN __attribute__ ((__noreturn__))
+       #define FUNCTION_NAME __PRETTY_FUNCTION__
 #endif
 
 // Whether to catch all std::exceptions.
@@ -50,30 +55,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        #define CATCH_UNHANDLED_EXCEPTIONS 0
 #endif
 
-/*
-       Debug output
-*/
-
-#define DTIME (getTimestamp()+": ")
-
-extern void debugstreams_init(bool disable_stderr, const char *filename);
-extern void debugstreams_deinit();
-
-// This is used to redirect output to /dev/null
-class Nullstream : public std::ostream {
-public:
-       Nullstream():
-               std::ostream(0)
-       {
-       }
-private:
-};
-
-extern std::ostream dstream;
-extern std::ostream dstream_no_stderr;
-extern Nullstream dummyout;
-
-
 /* Abort program execution immediately
  */
 __NORETURN extern void fatal_error_fn(
@@ -108,6 +89,8 @@ __NORETURN extern void sanity_check_fn(
 
 void debug_set_exception_handler();
 
+#define DTIME ""
+
 /*
        DebugStack
 */