Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed logging in dll #152

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmake/IonUtil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ function(ion_run NAME COMPILE_NAME)
add_custom_command(OUTPUT ${HEADER} ${STATIC_LIB}
COMMAND ${CMAKE_SOURCE_DIR}/script/invoke.bat $<TARGET_FILE:${COMPILE_NAME}>
HL_TARGET ${IER_TARGET_STRING}
PATH ${Halide_DIR}/../../../bin/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>
PATH ${CMAKE_BINARY_DIR}/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>
PATH ${CMAKE_BINARY_DIR}/src/bb/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>
PATH ${Halide_DIR}/../../../bin/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:RelWithDebInfo>:Release>
PATH ${CMAKE_BINARY_DIR}/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:RelWithDebInfo>:Release>
PATH ${CMAKE_BINARY_DIR}/src/bb/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:RelWithDebInfo>:Release>
DEPENDS ${COMPILE_NAME} ${OUTPUT_PATH}
WORKING_DIRECTORY ${OUTPUT_PATH})
endif()
Expand Down
10 changes: 10 additions & 0 deletions src/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@

#include "log.h"

namespace ion {
namespace log {

std::shared_ptr<spdlog::logger> get() {
return spdlog::get("ion");
}

} // log
} // ion

namespace {

struct Logger {
Expand Down
13 changes: 7 additions & 6 deletions src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

namespace ion {
namespace log {
template<class... Types> static void critical(Types... args) { spdlog::get("ion")->critical(args...); }
template<class... Types> static void error (Types... args) { spdlog::get("ion")->error (args...); }
template<class... Types> static void warn (Types... args) { spdlog::get("ion")->warn (args...); }
template<class... Types> static void info (Types... args) { spdlog::get("ion")->info (args...); }
template<class... Types> static void debug (Types... args) { spdlog::get("ion")->debug (args...); }
template<class... Types> static void trace (Types... args) { spdlog::get("ion")->trace (args...); }
std::shared_ptr<spdlog::logger> get();
template<class... Types> static void critical(Types... args) { get()->critical(args...); }
template<class... Types> static void error (Types... args) { get()->error (args...); }
template<class... Types> static void warning (Types... args) { get()->warning (args...); }
template<class... Types> static void info (Types... args) { get()->info (args...); }
template<class... Types> static void debug (Types... args) { get()->debug (args...); }
template<class... Types> static void trace (Types... args) { get()->trace (args...); }
} // log
} // ion

Expand Down
Loading