Skip to content

chore: Update logging#84

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Kakueeen:master
May 28, 2025
Merged

chore: Update logging#84
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Kakueeen:master

Conversation

@Kakueeen
Copy link
Contributor

@Kakueeen Kakueeen commented May 27, 2025

  • Enhanced logging throughout the application for better debugging and tracking of events.
  • Added .vscode, .cursor, and .specstory files to .gitignore to prevent unnecessary files from being tracked.
  • Improved initialization and error handling messages in various components for clarity.

Log: Update logging

- Enhanced logging throughout the application for better debugging and tracking of events.
- Added .vscode, .cursor, and .specstory files to .gitignore to prevent unnecessary files from being tracked.
- Improved initialization and error handling messages in various components for clarity.

Log: Update logging
@sourcery-ai
Copy link

sourcery-ai bot commented May 27, 2025

Reviewer's Guide

This PR enriches the application’s observability by systematically adding detailed logging (qDebug, qInfo, qWarning, qCritical) across core installer, service/interface, utility, SevenZip and UI modules, and updates .gitignore to exclude IDE and temp files.

Updated Class Diagram for QtBaseInstaller (Enhanced Logging)

classDiagram
  class QtBaseInstaller {
    +QtBaseInstaller(QObject *parent)
    +setformat(bool bFormat)
    +setPartionName(const QString& strPartionName)
    +setImage(const QString& strImage)
    +beginInstall()
    +checkError()
    +stopInstall()
    +hasEnoughSpace() bool
    +checkISOIntegrity() bool
    +umountPartion() bool
    +umountDisk() bool
    +ejectDisk() bool
    +formatUsb() bool
    +installBootload() bool
    +extractISO() bool
    +syncIO() bool
    +configSyslinux() bool
    +needAddRepo() bool
    +modifyBootGrubFile(QString grub_file_name)
  }
Loading

Updated Class Diagram for BootMakerService (Enhanced Logging)

classDiagram
  class BootMakerService {
    +BootMakerService(QObject *parent)
    +~BootMakerService()
    +Reboot()
    +Start()
    +Stop()
    +DeviceList() QString
    +Install(const QString& image, const QString& device, const QString& partition, bool formatDevice) bool
    +CheckFile(const QString& filepath) bool
  }
  class BootMakerServicePrivate {
    +BootMakerServicePrivate(BootMakerService* q)
    +checkCaller() bool
    +dbusCallerPid() qint64
  }
  BootMakerService *-- "1" BootMakerServicePrivate : d_ptr
Loading

Updated Class Diagram for DeviceMonitor (Enhanced Logging)

classDiagram
  class DeviceMonitor {
    +DeviceMonitor(QObject *parent)
    +deviceList() const QList<DeviceInfo>
    +getIntersectDevice(const QList<DeviceInfo>& list) QList<DeviceInfo>
    +getNorDevice(const QList<DeviceInfo>& calcuList, const QList<DeviceInfo>& compareList) QList<DeviceInfo>
    %% Methods' internal logic and constructor lambdas updated with logging
  }
Loading

Updated Class Diagram for UI (BMWindow & SlideAnimatoin - Enhanced Logging)

classDiagram
  class BMWindow {
    +BMWindow(QWidget *parent)
    +slot_ThemeChange()
    +~BMWindow()
    +closeEvent(QCloseEvent *event)
    +slideWidget(DWidget *left, DWidget *right, int iDirection)
    %% Methods and constructor lambdas updated with logging
  }
  class SlideAnimatoin {
    +SlideAnimatoin()
    +~SlideAnimatoin()
    +initAnimation(DWidget* pLeftWidget, DWidget* pRightWidget, int iDirection)
    +slot_AnimationGroupFinished()
  }
  BMWindow ..> SlideAnimatoin : creates
Loading

Updated Class Diagram for SevenZip Utilities (Enhanced Logging)

classDiagram
  class SevenZip {
    +SevenZip(const QString& image, const QString& target, QObject* parent)
    +setArchiveFile(const QString& archiveFile)
    +setOutputDirectory(const QString& outputDir)
    +stopProcess()
    +extract() bool
    +check() bool
    +handleFinished()
  }
  class SevenZipProcessParser {
    +SevenZipProcessParser(const QString& file, QProcess* process, QObject* parent)
    +run()
  }
  SevenZip ..> SevenZipProcessParser : uses
Loading

File-Level Changes

Change Details Files
Enhanced logging in installer classes
  • Inserted method entry/exit debug logs in QtBaseInstaller
  • Logged success/failure and progress of each installation step
  • Clarified error and warning messages during install and stop flows
src/libdbm/installer/qtbaseinstaller.cpp
src/libdbm/installer/qtX86Installer.cpp
src/libdbm/installer/qtmipsinstaller.cpp
src/libdbm/installer/qtinstallerfactory.cpp
Added logging in service and interface layers
  • Startup, D-Bus registration and shutdown logs in BootMakerService and main
  • Authorization check tracing and signal-connection debug messages
  • BMInterface initialization and handler thread move logs
src/service/bootmakerservice.cpp
src/service/main.cpp
src/libdbm/bminterface.cpp
Instrumented utility and device-monitor modules with logs
  • Encoding validation and resource/loading debug messages in utils
  • Detailed mount/unmount and disk-operation logs
  • Device detection and change-event tracing in DeviceMonitor
src/libdbm/util/utils.cpp
src/libdbm/util/devicemonitor.cpp
UI interaction and view transition logging
  • Initialization and theme-change logs in BMWindow
  • User action, file selection and navigation logs in ISOSelectView and UsbSelectView
  • Error/results display and button-click tracing in ResultView and FormatDialog
src/app/bmwindow.cpp
src/app/view/isoselectview.cpp
src/app/view/usbselectview.cpp
src/app/view/resultview.cpp
src/app/view/formatdialog.cpp
src/app/view/deviceinfoitem.cpp
Extended SevenZip process logging
  • Initialization and command execution debug logs
  • Extraction/integrity check start/finish messages
  • SevenZip progress parser updates and termination logs
src/libdbm/util/sevenzip.cpp
Updated .gitignore
  • Added rules to ignore .vscode, .cursor and .specstory files
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a 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 and found some issues that need to be addressed.

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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

qInfo() << "Starting Boot Maker Service";

QString PATH = qgetenv("PATH");
qDebug() << "Initial PATH:" << PATH;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Logging full PATH may expose sensitive environment data

Log only necessary environment variables or mask sensitive information in PATH to avoid exposing private data.

@deepin-ci-robot
Copy link

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Kakueeen
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 28, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit a41d20d into linuxdeepin:master May 28, 2025
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants