Skip to content

Commit

Permalink
Updated call stack logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder committed Aug 13, 2023
1 parent fcb2db6 commit 61dcada
Show file tree
Hide file tree
Showing 72 changed files with 227 additions and 836 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set(ssGUI_BUILD_EXAMPLES ON CACHE BOOL "Build examples")
set(ssGUI_LOG_LEVEL "Warning" CACHE STRING "Log level")
set(ssGUI_LOG_TAG "None" CACHE STRING "Log tag (overrides level)")
set(ssGUI_LOG_MANAGER_STATE OFF CACHE BOOL "Log all the state in ssGUIManager")
set(ssGUI_USE_LOG_FUNC OFF CACHE BOOL "Logs all recorded function call")

#Dropdown
set_property(CACHE ssGUI_LOG_LEVEL PROPERTY STRINGS "None"
Expand Down Expand Up @@ -444,6 +445,9 @@ if(ssGUI_LOG_MANAGER_STATE)
target_compile_definitions(ssGUI PUBLIC SSGUI_LOG_MANAGER_STATE=1)
endif()

if(ssGUI_USE_LOG_FUNC)
target_compile_definitions(ssGUI PUBLIC ssGUI_USE_LOG_FUNC=1)
endif()
#See ssGUI/HelperClasses/LogWithTagsAndLevel.hpp for log tags and levels
if(NOT ssGUI_LOG_TAG STREQUAL "None")
if(ssGUI_LOG_TAG STREQUAL "ssGUI_MANAGER_TAG")
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Backend/Mocks/MockMacro.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SSGUI_MOCK_MACRO_H
#define SSGUI_MOCK_MACRO_H

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#define SSGUI_MOCK_PASSTHROUGH(funcOp)\
do\
Expand Down
2 changes: 1 addition & 1 deletion Include/ssGUI/Enums/SystemKey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cstdint>

//We need to undefine the DELETE macro from Win32 because this collides with our enum name
#ifdef SSGUI_MAIN_BACKEND_WIN32_OPENGL
#ifdef DELETE
#undef DELETE
#endif

Expand Down
4 changes: 1 addition & 3 deletions Include/ssGUI/GUIObjectClasses/CompositeClasses/MenuItem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace ssGUI
============================== C++ ==============================
MenuItem::MenuItem()
{
ssLOG_FUNC_ENTRY();
ssGUI_LOG_FUNC();
RemoveAnyExtension<ssGUI::Extensions::BoxShadow>();
RemoveAnyExtension<ssGUI::Extensions::RoundedCorners>();
Expand Down Expand Up @@ -72,8 +72,6 @@ namespace ssGUI
}
}
);
ssLOG_FUNC_EXIT();
}
=================================================================
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace ssGUI
ButtonMode(StandardButton::Mode::TEXT),
ButtonImageWrapper(-1)
{
ssLOG_FUNC_ENTRY();
ssGUI_LOG_FUNC();
SetSize(glm::vec2(70, 35));
//Adjust Extensions
Expand Down Expand Up @@ -160,8 +160,6 @@ namespace ssGUI
UpdateButtonText();
UpdateButtonImage();
NotifyButtonEventCallbackManually();
ssLOG_FUNC_EXIT();
}
=================================================================
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace ssGUI
WindowIcon(-1),
CloseButton(-1)
{
ssLOG_FUNC_ENTRY();
ssGUI_LOG_FUNC();
SetMinSize(glm::vec2(100, 100));
SetTitlebarHeight(26);
Expand Down Expand Up @@ -189,8 +189,6 @@ namespace ssGUI
standardWindow->CleanUpDefaultResources();
}
);
ssLOG_FUNC_EXIT();
}
int StandardWindow::StandardWindowObjectCount = 0;
Expand Down
3 changes: 1 addition & 2 deletions Include/ssGUI/HelperClasses/ImageUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ namespace ssGUI

static void ResizeBilinear(const uint8_t* inputPixels, int w, int h, uint8_t* outputPixels, int w2, int h2)
{
ssLOG_FUNC_ENTRY();
ssGUI_LOG_FUNC();
const uint8_t* a;
const uint8_t* b;
const uint8_t* c;
Expand Down Expand Up @@ -556,7 +556,6 @@ namespace ssGUI
offset++;
}
}
ssLOG_FUNC_EXIT();
}

//Assuming is RGBA32
Expand Down
10 changes: 9 additions & 1 deletion Include/ssGUI/HelperClasses/LogWithTagsAndLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@

#endif

//#undef ssLOG_LINE
#if ssGUI_USE_LOG_FUNC
#define ssGUI_LOG_FUNC(...) ssLOG_FUNC(__VA_ARGS__)
#define ssGUI_LOG_FUNC_ENTRY(...) ssLOG_FUNC_ENTRY(__VA_ARGS__)
#define ssGUI_LOG_FUNC_EXIT(...) ssLOG_FUNC_EXIT(__VA_ARGS__)
#else
#define ssGUI_LOG_FUNC(...) do{} while(0)
#define ssGUI_LOG_FUNC_ENTRY(...) do{} while(0)
#define ssGUI_LOG_FUNC_EXIT(...) do{} while(0)
#endif

#endif
2 changes: 1 addition & 1 deletion Src/Examples/CustomGraphicsExampleV2.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "glad/glad.h"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

//Modified from https://github.com/opengl-tutorials/ogl/blob/master/common/shader.cpp
int CreateShaders(std::string& vertexShaderCode, std::string& fragmentShaderCode)
Expand Down
2 changes: 1 addition & 1 deletion Src/Examples/Playground/ImageCanvasPlayground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ssGUI/GUIObjectClasses/CompositeClasses/ImageCanvas.hpp"
#include "ssGUI/Extensions/Border.hpp"

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ExamplesResources.h"

//Image Test
Expand Down
2 changes: 1 addition & 1 deletion Src/Examples/Playground/SliderPlayground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ssGUI/GUIObjectClasses/CompositeClasses/ImageCanvas.hpp"
#include "ssGUI/Extensions/Border.hpp"

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ExamplesResources.h"

//Image Test
Expand Down
2 changes: 1 addition & 1 deletion Src/Examples/Playground/StandardSliderPlayground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "ssGUI/GUIObjectClasses/CompositeClasses/ImageCanvas.hpp"
#include "ssGUI/Extensions/Border.hpp"

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ExamplesResources.h"

//Image Test
Expand Down
2 changes: 1 addition & 1 deletion Src/Examples/Playground/StandardWindowPlayground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssGUI/Extensions/Border.hpp"

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ExamplesResources.h"

//Image Test
Expand Down
2 changes: 1 addition & 1 deletion Src/Examples/Playground/TextfieldPlayground.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"

#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ExamplesResources.h"

int main()
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/AutoTests/BackendTests/BackendFontTest_Auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ssGUI/Backend/Interfaces/BackendFontInterface.hpp"
#include "ssGUI/DataClasses/ImageData.hpp"
#include "ssTest.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include "TestsResources.h"
#include <fstream>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ssGUI/Backend/BackendFactory.hpp"
#include "ssGUI/Factory.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ssTest.hpp"

#ifdef SSGUI_MAIN_BACKEND_SFML
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/AutoTests/BackendTests/DynamicAtlasTest_Auto.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/Backend/DynamicImageAtlas.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include "ssGUI/HelperClasses/OutputStreamUtil.hpp"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ssGUI/Backend/BackendFactory.hpp"
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include <thread>
#include "TestsResources.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ssGUI/DataClasses/ImageData.hpp"
#include "ssGUI/Factory.hpp"
#include "ssGUI/HeaderGroups/InputGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include <thread>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ssGUI/Backend/BackendFactory.hpp"
#include "ssGUI/DataClasses/ImageData.hpp"
#include "ssGUI/Factory.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "ssGUI/HelperClasses/GenericInputToString.hpp"
#include "TestsResources.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "ssGUI/Backend/BackendFactory.hpp"
#include "ssGUI/DataClasses/ImageData.hpp"
#include "ssGUI/Factory.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include <iostream>
#include <thread>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow;
ssGUI::Button* TestButton;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"


ssGUI::MainWindow* MainWindow;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssGUI/GUIObjectClasses/CompositeClasses/Dropdown.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::ssGUIManager* Manager;
ssGUI::MainWindow* MainWindow;
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/GUIObjectTests/ButtonTest_Manual.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow = nullptr;
ssGUI::ssGUIManager* Manager = nullptr;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow = nullptr;
ssGUI::ssGUIManager* Manager = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/GUIObjectTests/ImageTest_Manual.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

#include "TestsResources.h"

Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/GUIObjectTests/MenuTest_Manual.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow = nullptr;
ssGUI::ssGUIManager* Manager = nullptr;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include <cassert>

ssGUI::MainWindow* MainWindow = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/GUIObjectTests/TextTest_Manual.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"
#include "TestsResources.h"

ssGUI::MainWindow* MainWindow = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/GUIObjectTests/WindowTest_Manual.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow = nullptr;
ssGUI::ssGUIManager* Manager = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/ManualTestTemplate.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

//[Variables Declaration]

Expand Down
2 changes: 1 addition & 1 deletion Src/Tests/ManualTests/ManualTestTemplateWithModes.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ssGUI/HeaderGroups/StandardGroup.hpp"
#include "ssLogger/ssLog.hpp"
#include "ssGUI/HelperClasses/LogWithTagsAndLevel.hpp"

ssGUI::MainWindow* MainWindow = nullptr;
ssGUI::ssGUIManager* Manager = nullptr;
Expand Down
Loading

0 comments on commit 61dcada

Please sign in to comment.