diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index b1ba30553e..45a3336304 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "unix/fhs.hpp" // Generated by CMake from ../platform/unix/fhs.hpp.in @@ -59,6 +60,9 @@ PrinterTechnology get_printer_technology(const DynamicConfig &config) int CLI::run(int argc, char **argv) { + // Switch boost::filesystem to utf8. + boost::nowide::nowide_filesystem(); + if (! this->setup(argc, argv)) return 1; @@ -499,6 +503,7 @@ int CLI::run(int argc, char **argv) bool CLI::setup(int argc, char **argv) { { + Slic3r::set_logging_level(1); const char *loglevel = boost::nowide::getenv("SLIC3R_LOGLEVEL"); if (loglevel != nullptr) { if (loglevel[0] >= '0' && loglevel[0] <= '9' && loglevel[1] == 0) diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index ea5e3edec9..2e917ea57d 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -92,15 +91,6 @@ unsigned get_logging_level() } } -// Force set_logging_level(<=error) after loading of the DLL. -// Switch boost::filesystem to utf8. -static struct RunOnInit { - RunOnInit() { - boost::nowide::nowide_filesystem(); - set_logging_level(1); - } -} g_RunOnInit; - void trace(unsigned int level, const char *message) { boost::log::trivial::severity_level severity = level_to_boost(level);