Log support through boost::log

This commit is contained in:
bubnikv 2016-11-24 13:44:51 +01:00
parent e67e37c772
commit 0d20a81354
5 changed files with 64 additions and 1 deletions

View file

@ -18,6 +18,8 @@ sub debugf {
printf @_ if $debug;
}
our $loglevel = 0;
# load threads before Moo as required by it
our $have_threads;
BEGIN {
@ -104,6 +106,10 @@ my $pause_sema = Thread::Semaphore->new;
my $parallel_sema;
my $paused = 0;
# Set the logging level at the Slic3r XS module.
$Slic3r::loglevel = (defined($ENV{'SLIC3R_LOGLEVEL'}) && $ENV{'SLIC3R_LOGLEVEL'} =~ /^[1-9]/) ? $ENV{'SLIC3R_LOGLEVEL'} : 0;
set_logging_level($Slic3r::loglevel);
sub spawn_thread {
my ($cb) = @_;