From 88a38cf9ba7469f58ecf5662a87b179ae6e1b901 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Fri, 31 May 2024 14:51:29 -0500 Subject: [PATCH] fix reference in python/change default logging level (#135) --- src/parallelzone/logging/detail_/spdlog/spdlog.cpp | 4 ++-- src/python/runtime/runtime_view.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parallelzone/logging/detail_/spdlog/spdlog.cpp b/src/parallelzone/logging/detail_/spdlog/spdlog.cpp index 4af27a4e..fba5a622 100644 --- a/src/parallelzone/logging/detail_/spdlog/spdlog.cpp +++ b/src/parallelzone/logging/detail_/spdlog/spdlog.cpp @@ -62,7 +62,7 @@ inline auto map_severity_levels(Logger::severity s) { // ----------------------------------------------------------------------------- SpdlogPIMPL::SpdlogPIMPL(spdlog_type logger) : m_logger_(std::move(logger)) { - m_logger_.set_level(spdlog::level::trace); + m_logger_.set_level(spdlog::level::info); } SpdlogPIMPL::pimpl_ptr SpdlogPIMPL::clone_() const { @@ -89,4 +89,4 @@ bool SpdlogPIMPL::are_equal_(const LoggerPIMPL& other) const noexcept { return m_logger_.name() == p->m_logger_.name(); } -} // namespace parallelzone::detail_ \ No newline at end of file +} // namespace parallelzone::detail_ diff --git a/src/python/runtime/runtime_view.cpp b/src/python/runtime/runtime_view.cpp index ee0a4325..e2892405 100644 --- a/src/python/runtime/runtime_view.cpp +++ b/src/python/runtime/runtime_view.cpp @@ -31,7 +31,8 @@ void export_runtime_view(pybind11::module_& m) { .def("has_me", &RuntimeView::has_me) .def("my_resource_set", &RuntimeView::my_resource_set) .def("count", &RuntimeView::count) - .def("logger", &RuntimeView::logger) + .def("logger", &RuntimeView::logger, + pybind11::return_value_policy::reference_internal) .def("stack_callback", &RuntimeView::stack_callback) .def(pybind11::self == pybind11::self) .def(pybind11::self != pybind11::self);