diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b157a595ec..36a57fd3ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -201,12 +201,9 @@ if (WIN32) if(MSVC) target_link_options(OrcaSlicer_app_gui PUBLIC "$<$:/DEBUG>") endif() - target_compile_definitions(OrcaSlicer_app_gui PRIVATE "$<$>:SLIC3R_WRAPPER_NOCONSOLE>") + target_compile_definitions(OrcaSlicer_app_gui PRIVATE -DSLIC3R_WRAPPER_NOCONSOLE) add_dependencies(OrcaSlicer_app_gui OrcaSlicer) - set_target_properties(OrcaSlicer_app_gui PROPERTIES - OUTPUT_NAME "orca-slicer" - WIN32_EXECUTABLE "$>" - ) + set_target_properties(OrcaSlicer_app_gui PROPERTIES OUTPUT_NAME "orca-slicer") target_link_libraries(OrcaSlicer_app_gui PRIVATE boost_headeronly) endif () diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 1c3f0c19f5..3a97e6a076 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -535,7 +535,6 @@ endif () encoding_check(libslic3r) target_compile_definitions(libslic3r PUBLIC -DUSE_TBB -DTBB_USE_CAPTURED_EXCEPTION=0) -target_compile_definitions(libslic3r PRIVATE $<$:SLIC3R_CONSOLE_LOG>) target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(libslic3r SYSTEM PUBLIC ${EXPAT_INCLUDE_DIRS}) diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp index 62b2eeb78e..14ad6bc1d7 100644 --- a/src/libslic3r/Utils.hpp +++ b/src/libslic3r/Utils.hpp @@ -197,7 +197,6 @@ std::string debug_out_path(const char *name, ...); // smaller level means less log. level=5 means saving all logs. void set_log_path_and_level(const std::string& file, unsigned int level); void flush_logs(); -void shutdown_console_logging(); boost::filesystem::path get_log_file_name(); // A special type for strings encoded in the local Windows 8-bit code page. diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index 5f429f076a..b3fd890c3e 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -51,19 +50,14 @@ #include #include #include -#include #include -#include #include #include #include #include #include -#include #include -#include -#include #include #include @@ -184,7 +178,6 @@ unsigned get_logging_level() } boost::shared_ptr> g_log_sink; -boost::shared_ptr> g_console_log_sink; // Force set_logging_level(<=error) after loading of the DLL. // This is currently only needed if libslic3r is loaded as a shared library into Perl interpreter @@ -357,19 +350,6 @@ namespace src = boost::log::sources; namespace expr = boost::log::expressions; namespace keywords = boost::log::keywords; namespace attrs = boost::log::attributes; -namespace sinks = boost::log::sinks; - -void shutdown_console_logging() -{ - if (!g_console_log_sink) - return; - - auto console_sink = g_console_log_sink; - boost::log::core::get()->remove_sink(console_sink); - console_sink->stop(); - g_console_log_sink.reset(); -} - void set_log_path_and_level(const std::string& file, unsigned int level) { #ifdef __APPLE__ @@ -401,24 +381,6 @@ void set_log_path_and_level(const std::string& file, unsigned int level) keywords::auto_flush = true ); - shutdown_console_logging(); - -#ifdef SLIC3R_CONSOLE_LOG - auto console_backend = boost::make_shared(); - console_backend->add_stream(boost::shared_ptr(&std::cout, boost::null_deleter())); - console_backend->auto_flush(true); - - g_console_log_sink = boost::make_shared>(console_backend); - g_console_log_sink->set_formatter( - expr::stream - << "[" << expr::attr< logging::trivial::severity_level >("Severity") << "]\t" - << expr::format_date_time< boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S.%f") << " " - <<"[Thread " << expr::attr("ThreadID") << "]" - << ": " << expr::smessage - ); - boost::log::core::get()->add_sink(g_console_log_sink); -#endif - logging::add_common_attributes(); set_logging_level(level); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 9a846b1aaa..824c266176 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2355,7 +2355,6 @@ GUI_App::~GUI_App() BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": exit"); - shutdown_console_logging(); } bool GUI_App::is_blocking_printing(MachineObject *obj_)