Adds enhanced logging capabilities to OrcaSlicer, specifically around network testing and version information#448
Open
SukiSunYuhang wants to merge 7 commits into
Open
Adds enhanced logging capabilities to OrcaSlicer, specifically around network testing and version information#448SukiSunYuhang wants to merge 7 commits into
SukiSunYuhang wants to merge 7 commits into
Conversation
- Sync NetworkTestDialog UI logs to Boost.Log file log with [NetworkTest] tag - Add log_section_header() helper for formatted section headers in test output - Add separator lines around version info block at startup and exit - Log version info on normal exit (~GUI_App) and abnormal exit (generic_exception_handle) - Remove duplicate log_version_info() call from OnExit()
feature: sync network test logs to file and enhance version info logging
…gs (#324) * refactor: move log_version_info into GUI_App class and invoke on log export Make log_version_info() a static method of GUI_App instead of a global free function. Also call it from export_logs() so exported log files always include the version information block. * fix: delay version info logging until user confirms log export, and flush immediately Move GUI_App::log_version_info() call in export_logs() to after the save dialog confirmation so version info is only written when the user actually exports. Add flush_logs() to log_version_info() to ensure the version block is physically written to disk before the ZIP is created. * fix: force FlushFileBuffers after log flush to prevent truncated log export on Windows * Update utils.cpp * Update utils.cpp * Add Todo: flush_logs may have truncation issues.
…ocale init (#336) * fix: thread-safety fixes for log_version_info and flush_logs, Linux locale init - log_version_info: cache OS description with std::call_once to prevent wxGetLinuxDistributionInfo/wxGetOsDescription from being called on background threads (GTK/wx APIs are not thread-safe on Linux). Previously, generic_exception_handle -> OnExceptionInMainLoop could trigger these calls from BackgroundSlicingProcess worker threads, causing crashes when opening network test dialog on Linux. - flush_logs: add mutex to protect g_log_sink shared_ptr access against concurrent flush calls from multiple threads. - on_init_inner: call std::setlocale(LC_ALL, "") on Linux early in startup to fix garbled Chinese text and GTK file dialog crashes. - NetworkTestDialog::start_all_job: add atomic flag to prevent re-entrant test launches from rapid button clicks. * fix: add Linux paths for get_profile_version, get_flutter_version, getLocalArea, getLanguage All four functions had empty #else (Linux) branches, causing them to always return empty strings on Linux. Added get_linux_config_dir() helper that resolves $XDG_CONFIG_HOME/Snapmaker_Orca or ~/.config/Snapmaker_Orca, consistent with how data_dir() is determined on Linux. * Fix crash issue when writing logs during network tests under extreme scenarios. * Close the dialog with a maximum wait of 3-5 seconds; if it times out, detach and let the m_closing checkpoint handle the rest. * refactor: move log writing to main thread and simplify update_status with CallAfter * Update NetworkTestDialog * Move network test log writing from worker threads to the main thread, eliminating the CallAfter crash risk. * add log * delete error mutex
Add a condition check for the default branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds enhanced logging capabilities to OrcaSlicer, specifically around network testing and version information.
Changes
log_version_infoandflush_logs