Commit 61f939d7 authored by Tomáš Jakubec's avatar Tomáš Jakubec
Browse files

Json logger

fix of operator- for traited classes
parent d07b7bd1
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -5,3 +5,6 @@ CONFIG -= qt


SOURCES += \
SOURCES += \
        main.cpp
        main.cpp

HEADERS += \
    ../src/Debug/JSONLogger.h
+4 −2
Original line number Original line Diff line number Diff line
@@ -2369,6 +2369,8 @@ void testTraitsTuple(){
    get<0>(t) = 2.5;
    get<0>(t) = 2.5;
    auto foo = static_cast<double&(*)(std::tuple<double>&)>(std::get<0>);
    auto foo = static_cast<double&(*)(std::tuple<double>&)>(std::get<0>);
    DBGVAR(foo(t), t);
    DBGVAR(foo(t), t);
    DBGVAR_JSON(t,t,t,t);
    DBGCHECK;
}
}


/*
/*
@@ -2420,9 +2422,9 @@ int main()
    //testPrivateTrait();
    //testPrivateTrait();
    //testJson();
    //testJson();
    //testTestTraits();
    //testTestTraits();
    testTraitsAlgorithms();
    //testTraitsAlgorithms();
    //testNumericTraitsPerformance();
    //testNumericTraitsPerformance();
    //testTraitsTuple();
    testTraitsTuple();
    //testFactorial();
    //testFactorial();
    return 0;
    return 0;
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@ SOURCES += \
        main.cpp \
        main.cpp \


HEADERS += \
HEADERS += \
    ../src/Debug/JSONLogger.h \
    ../src/Macros/MacroForEach.h \
    ../src/Macros/MacroForEach.h \
    ../src/Debug/CSVLogger.h \
    ../src/Debug/CSVLogger.h \
    ../src/Debug/ConsoleLogger.h \
    ../src/Debug/ConsoleLogger.h \
+3 −3
Original line number Original line Diff line number Diff line
#include <iostream>
#include <iostream>
#include <string>
#include <string>
//#define UNDEBUG
//#define UNDEBUG
#define CONSOLE_COLOURED_OUTPUT
#define CONSOLE_COLORED_OUTPUT
#include "../src/Debug/Debug.h"
#include "../src/Debug/Debug.h"
#include "../src/UnstructuredMesh/UnstructuredMesh.h"
#include "../src/UnstructuredMesh/UnstructuredMesh.h"
#include "../src/UnstructuredMesh/MeshFunctions/MeshFunctions.h"
#include "../src/UnstructuredMesh/MeshFunctions/MeshFunctions.h"
@@ -1019,9 +1019,9 @@ void testFPMA_poly(){
int main()
int main()
{
{
    //meshSize();
    //meshSize();
    //testMesh2D();
    testMesh2D();
    //testMesh2DLoadAndWrite();
    //testMesh2DLoadAndWrite();
    //testMesh3D();
    testMesh3D();
    //test3DMeshDeformedPrisms();
    //test3DMeshDeformedPrisms();
    testMeshRefine();
    testMeshRefine();
    //testMeshDataContainer();
    //testMeshDataContainer();
+22 −9
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@
#include <iostream>
#include <iostream>
#include "HTMLLogger.h"
#include "HTMLLogger.h"
#include "CSVLogger.h"
#include "CSVLogger.h"
#include "JSONLogger.h"
#include "ConsoleLogger.h"
#include "ConsoleLogger.h"
#include <stdexcept>
#include <stdexcept>
/*
/*
@@ -16,10 +17,12 @@ namespace dbg {
    struct DBGStatics {
    struct DBGStatics {
        static HtmlLogger HDBGLog;
        static HtmlLogger HDBGLog;
        static CSVLogger CSVDBGLog;
        static CSVLogger CSVDBGLog;
        static JSONLogger JSONDBGLog;
    };
    };


    HtmlLogger DBGStatics::HDBGLog("DBG.html");
    HtmlLogger DBGStatics::HDBGLog("DBG.html");
    CSVLogger DBGStatics::CSVDBGLog("DBG.csv");
    CSVLogger DBGStatics::CSVDBGLog("DBG.csv");
    JSONLogger DBGStatics::JSONDBGLog("DBG.json");
}
}


#define STRVAR(var) #var, var
#define STRVAR(var) #var, var
@@ -42,7 +45,12 @@ abort();}


// Macros using csv debug output
// Macros using csv debug output
#define DBGVAR_CSV(...) dbg::DBGStatics::CSVDBGLog.writeVar(__LINE__, __FILE__, FOR_EACH(STRVAR, __VA_ARGS__))
#define DBGVAR_CSV(...) dbg::DBGStatics::CSVDBGLog.writeVar(__LINE__, __FILE__, FOR_EACH(STRVAR, __VA_ARGS__))
#define DBGVARCOND_CSV(condition, ...) if(condition) DBGVAR_HTML(__VA_ARGS__)
#define DBGVARCOND_CSV(condition, ...) if(condition) DBGVAR_CSV(__VA_ARGS__)

// Macros using json debug output
#define DBGVAR_JSON(...) dbg::DBGStatics::JSONDBGLog.writeVar(__LINE__, __FILE__, FOR_EACH(STRVAR, __VA_ARGS__))
#define DBGVARCOND_JSON(condition, ...) if(condition) DBGVAR_JSON(__VA_ARGS__)





#define DBGCHECK ConsoleLogger<>::writeMessage("--", __LINE__, __FILE__, "check line")
#define DBGCHECK ConsoleLogger<>::writeMessage("--", __LINE__, __FILE__, "check line")
@@ -62,13 +70,18 @@ abort();}


#define DBGTRY(code) code
#define DBGTRY(code) code


#define HTMLDBGVAR(...)
#define DBGVAR_HTML(...)

#define DBGVARCOND_HTML(condition, ...)

#define DBGVAR_CSV(...)

#define DBGVARCOND_CSV(condition, ...)


#define HTMLDBGCOND(condition, ...)
#define DBGVAR_JSON(...)


#define CSVDBGVAR(...)
#define DBGVARCOND_JSON(condition, ...)


#define CSVDBGCOND(condition, ...)
#endif //UNDEBUG
#endif //UNDEBUG


#endif // DEBUG_H
#endif // DEBUG_H
Loading