Provide an alternate use for confess_at to call Slic3r::Log instead of perl xs.

This commit is contained in:
Joseph Lenox 2018-06-25 23:35:24 -05:00 committed by Joseph Lenox
parent dc256eb989
commit 9a38d96dd4
2 changed files with 15 additions and 2 deletions

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <sstream> #include <sstream>
#include <iostream>
namespace Slic3r { namespace Slic3r {

View File

@ -1,6 +1,12 @@
#include <xsinit.h> #include "utils.hpp"
#include "utils.hpp"
#include <regex> #include <regex>
#ifndef NO_PERL
#include <xsinit.h>
#else
#include "Log.hpp"
#endif
#include <cstdarg>
void void
confess_at(const char *file, int line, const char *func, 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); call_pv("Carp::confess", G_DISCARD);
FREETMPS; FREETMPS;
LEAVE; 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 #endif
} }