-
Notifications
You must be signed in to change notification settings - Fork 166
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
Logging rework #807
Merged
Merged
Logging rework #807
Conversation
This file contains 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
added a menu item in the view menu for it
renamed log() to vlog() for now extracted console creation to Console class rewrote LogBuffer to work with logging from uibase, renamed to LogModel added fmt dependency
create log level combobox in code, set selected index based on value instead added log level to context menu in log list
replaced a few qDebug()
… access settings early set log level on startup replaced more qDebug()
replaced qWarnings() and qCritical()
added check for nahimic
log displays on startup
removed now unused vlog()
removed some commented out logging
replaced windowsErrorString() with formatSystemMessage()
initializing usvfs logging now logs strings for log level and crash dump type
moved context menu to LogList
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.
This is not as bad as it looks.
A lot of the modifications are actually moving all the logging stuff I did a while ago for modules, AVs, etc. from
util.cpp/h
to a bunch of newenv*.cpp/h
files. You can collapse these files.I changed all
qDebug()
,qInfo()
,qWarning()
andqCritical()
to the new logging functions. This is the bulk of the changes.I renamed
logbuffer.cpp/h
tologlist.cpp/h
, because it also handles the widget. I moved the widget to a docked window, changed the timestamp to include seconds and milliseconds, and added options to the context menu to clear the log and change the log level.Qt is buggy when saving and restoring dock positions. I added a class
DockFixer
inmainwindow.cpp
to fix the problems, all the gory details are in it.I added some logging on startup:
checkMissingFiles()
;checkNahimic()
;I removed a few logs that were noisy and unhelpful, such as the "network interface seems up". I also deleted a few commented out code blocks.
OrganizerCore
used to have theSettings
object as a member variable, initialized by aQSettings
passed in the constructor inrunApplication()
. Since logging has to be initialized as soon as possible, and I need the log level from the settings, I moved theSettings
object torunApplication()
itself.OrganizerCore
only has a reference to it now. It doesn't change much, just thatSettings
is created earlier.It used to be that
logbuffer.cpp
would register a callback to Qt's log to add entries to the list. This is now reversed:main.cpp
registers the callback inqtLogCallback()
, which forwards to the newlog
functions. The log list now has a callback to the new log instead.I removed
getCurrentErrorStringA()
andgetCurrentErrorStringW()
fromerrorreport.cpp/h
because they were redundant and used only in a few places. Now everything usesformatSystemMessage()
.