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 <vector>
#include <sstream>
#include <iostream>
namespace Slic3r {

View File

@ -1,6 +1,12 @@
#include <xsinit.h>
#include "utils.hpp"
#include <regex>
#ifndef NO_PERL
#include <xsinit.h>
#else
#include "Log.hpp"
#endif
#include <cstdarg>
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
}