Skip to content

Commit

Permalink
cleanup: remove old debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonkervliet committed Nov 16, 2023
1 parent 29d951b commit c473542
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -413,4 +413,6 @@ FodyWeavers.xsd
# End of https://www.toptal.com/developers/gitignore/api/visualstudio

.idea/
cmake-build-debug/
cmake-build-debug/
cmake-build-debug-android/
CMakeSettings.json
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ file(MAKE_DIRECTORY ${layer_directory})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${layer_directory})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${layer_directory})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${layer_directory})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${layer_directory})
# set(current_folder_path_prefix "./") # This works on windows too now with up-to-date OpenXR loaders
set(current_folder_path_prefix ".\\\\") # The line above did not work for me:
# <...>\repos\openxr-librnr\out\build\x64-Debug\XR_APILAYER_ATLARGE_RNR\./librnr.dll does not appear to exist
Expand All @@ -48,7 +49,7 @@ if(WIN32)
add_compile_definitions(/w26812)
endif()
else()
set(library_filename "${library_name}.so")
set(library_filename "lib${library_name}.so")
endif(WIN32)

configure_file(
Expand All @@ -74,6 +75,14 @@ add_custom_target(install_manifest
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/manifest.json ${layer_directory})
add_dependencies(${library_name} install_manifest)

if(ANDROID)
# This makes android's log library available to us
# TODO find out how to do this properly
# Current solution, see: https://stackoverflow.com/questions/45316915/undefined-reference-to-function-with-cmake-in-android-studio
find_library(loglib log)
target_link_libraries(${library_name} ${loglib})
endif()

# Several files use these compile time OS switches
if(WIN32)
add_definitions(-DXR_OS_WINDOWS)
Expand Down
2 changes: 1 addition & 1 deletion src/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

#include "pch.h"
#include "logger.h"

#include <sstream>

#if defined(_WIN32)
#include <Windows.h>
#endif

#if defined(ANDROID)
#include <android/log.h>
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, "hello_xr", __VA_ARGS__)
#define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, "hello_xr", __VA_ARGS__)
#endif
Expand Down
9 changes: 0 additions & 9 deletions src/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ namespace tracer {
// The first time we are asked to read an entry, set the requested timestamp as zero.
static XrTime start = entry->time;

Log::Write(Log::Level::Info, "A");

// Read a line from the trace
string line;
if (!getline(trace, line))
Expand All @@ -105,8 +103,6 @@ namespace tracer {
return false;
}

Log::Write(Log::Level::Info, "B");

// Depending on the trace record type, we need to read different fields
if (entry->type == 's') {
traceLocation l;
Expand Down Expand Up @@ -165,17 +161,12 @@ namespace tracer {
// Keep track of the highest (most recent) timestamp read, used in readUntil
mostRecentEntry = entry->time;

Log::Write(Log::Level::Info, "C");

return true;
}

bool readUntil(traceEntry* entry)
{
auto until = entry->time;
stringstream buffer;
buffer << "RNR " << mostRecentEntry << " " << time;
Log::Write(Log::Level::Info, buffer.str());
bool res;
for (res = true; res && mostRecentEntry <= until; res = read(entry))
{
Expand Down

0 comments on commit c473542

Please sign in to comment.