#include "Lazy.hpp" #include #include #include namespace Slic3r { namespace GUI { LazyBase::OnDemandBuild::OnDemandBuild(const LazyBase& lazy) : m_lazy(lazy), m_started(std::chrono::steady_clock::now()) { // The unit tests have no app. if (wxTheApp != nullptr) m_busy = std::make_unique(); } LazyBase::OnDemandBuild::~OnDemandBuild() { BOOST_LOG_TRIVIAL(info) << "Lazy::ensure: built " << m_lazy.name() << " on demand, " << m_units << " unit(s) in " << std::chrono::duration_cast(std::chrono::steady_clock::now() - m_started).count() << " ms"; } void LazyBase::log_null_factory(const std::string& name) { BOOST_LOG_TRIVIAL(error) << "Lazy::build_step: the factory for " << name << " returned null"; } }} // namespace Slic3r::GUI