-
Notifications
You must be signed in to change notification settings - Fork 19
feat: enhance logging #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added detailed debug logging throughout the application to improve traceability and debugging. - Updated .gitignore to exclude build artifacts and additional temporary files. Log: Improved logging for better diagnostics
deepin pr auto review关键摘要:
是否建议立即修改:
|
Reviewer's GuideThis PR systematically injects detailed qDebug/qWarning statements across the application’s core components to surface internal state and error contexts during disk operations, startup, and CLI handling, and updates .gitignore to omit build and temporary files. Class Diagram: Core Components with Enhanced LoggingclassDiagram
class MainWindow {
+initConnect()
+formatDevice()
+nextStep()
+onFormatingFinished(const bool& successful)
+closeEvent(QCloseEvent* event)
%% Methods enhanced with logging
}
class UDisksBlock {
+displayName() const
+iconName() const
+sizeUsed() const
%% Methods enhanced with logging
}
class SingletonApp {
+getServerPathByKey(const QString& key)
+setSingletonApplication(const QString& key)
+readData()
%% Methods enhanced with logging
}
class CMDManager {
+getPath()
+showHelp(int exitCode)
+getWinId()
%% Methods enhanced with logging
}
Flow Diagram: Logging Enhancements in Application Startup (main.cpp)graph TD
A[Start App] --> LogStart["Log: App Starting"];
LogStart --> B[Detect Session Type];
B --> LogSession["Log: Session Detected (Wayland/X11)"];
LogSession --> C[Set Singleton Application];
C --> LogSingleton["Log: Singleton Setup Info"];
C -- Fails --> Exit1["Log: Exit (Not Singleton)"];
C -- Succeeds --> D[Load Translations];
D --> LogTranslations["Log: Translation Load Info"];
LogTranslations --> E[Process CMD Args];
E -- Help Needed --> LogHelp["Log: Show Help"];
E -- Path Provided --> F[Check Device Read-Only];
F --> LogDeviceCheck["Log: Device Read-Only Check"];
F -- Read-Only --> Exit2["Log: Exit (Read-Only Device)"];
F -- Writable --> G[Setup UI & Window Mode];
G --> LogWindowMode["Log: Window Mode Setup (if applicable)"];
LogWindowMode --> H[App Exec];
H --> LogExit["Log: Quick Exit"];
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Kakueeen - I've reviewed your changes - here's some feedback:
- Consider using QLoggingCategory instead of raw qDebug() calls so you can control verbosity per module and easily disable verbose logs in production builds.
- There are a lot of near-duplicate debug statements—try consolidating or trimming logs to only key events to prevent your output from becoming overwhelming and impacting performance.
- You allocate QTimer with new without setting a parent; attach it to a QObject (for example the MainWindow) to ensure it’s cleaned up automatically and avoid memory leaks.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Kakueeen, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
Log: Improved logging for better diagnostics
Summary by Sourcery
Enhance traceability by adding detailed debug logging across the application and update .gitignore to ignore build artifacts and temporary files
Enhancements:
Chores: