From 9a38d96dd491adf69c407ec11e54326968afb5e6 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Mon, 25 Jun 2018 23:35:24 -0500 Subject: [PATCH] Provide an alternate use for confess_at to call Slic3r::Log instead of perl xs. --- xs/src/libslic3r/Log.hpp | 1 + xs/src/libslic3r/utils.cpp | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/xs/src/libslic3r/Log.hpp b/xs/src/libslic3r/Log.hpp index f105dac0d..70e8616fc 100644 --- a/xs/src/libslic3r/Log.hpp +++ b/xs/src/libslic3r/Log.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace Slic3r { diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index 4c20f7654..4275f06f8 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -1,6 +1,12 @@ -#include -#include "utils.hpp" +#include "utils.hpp" #include +#ifndef NO_PERL +#include +#else +#include "Log.hpp" +#endif + +#include void confess_at(const char *file, int line, const char *func, @@ -26,6 +32,12 @@ confess_at(const char *file, int line, const char *func, call_pv("Carp::confess", G_DISCARD); FREETMPS; LEAVE; + #else + std::stringstream ss; + ss << "Error in function " << func << " at " << file << ":" << line << ": "; + ss << pat << "\n"; + + Slic3r::Log::error(std::string("Libslic3r"), ss.str() ); #endif }