chore: Add more logs - #190
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: re2zero 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 |
Add more logs for debug. 79.49% Log: Add more logs
Support dconfig logs rules. Log:Enable dconfig logs
deepin pr auto reviewBased on the code review, I can see that the application is using qDebug() statements throughout the codebase for logging. The issue you're experiencing where the application exits with code 0 and no output is likely due to the logging statements being compiled out in release builds. Here's what I found and how to fix it:
Solution 1: Keep debug output in release buildsAdd this to your # Force debug output in release builds
DEFINES += QT_MESSAGELOGCONTEXTSolution 2: Add proper logging categoriesCreate a proper logging system as shown in the code (I can see there's already a // Replace qDebug() calls with proper logging
qCDebug(appLog) << "Your message here";Solution 3: Add a main function to ensure proper exitModify your main.cpp to ensure proper cleanup and logging: #include <QLoggingCategory>
#include <QDebug>
Q_LOGGING_CATEGORY(appLog, "org.deepin.reader")
int main(int argc, char *argv[])
{
// Enable debug output
qSetMessagePattern("[%{time yyyy-MM-dd hh:mm:ss.zzz} %{type} %{function}:%{line}] %{message}");
qDebug() << "Application starting";
Application a(argc, argv);
// Rest of your main function...
qDebug() << "Application exiting";
return a.exec();
}Solution 4: Check your build configurationMake sure your build configuration doesn't define # Remove this line if present
# DEFINES += QT_NO_DEBUG_OUTPUTThe most immediate fix would be to add the Would you like me to provide more specific guidance on any of these solutions? |
|
/merge |
Add more logs for debug. 79.49%
Log: Add more logs