Skip to content

Commit

Permalink
chore: Improve logs
Browse files Browse the repository at this point in the history
- decrease level of repetetive button name log
- Move system reporting log to separate function
  • Loading branch information
pktiuk committed Nov 21, 2022
1 parent f56ca66 commit 50faa0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/joybuttontypes/joybutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ JoyButton::JoyButton(int sdl_button_index, int originset, SetJoystick *parentSet
m_index_sdl = sdl_button_index;
m_originset = originset;
quitEvent = true;
VERBOSE() << "Created button with ID: " << m_index_sdl << " For set: " << originset << " Name: " << getName();
DEBUG() << "Created button with ID: " << m_index_sdl << " For set: " << originset << " Name: " << getName();
}

JoyButton::~JoyButton()
Expand Down
31 changes: 19 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,24 @@ void importLegacySettingsIfExist()
}
}

void log_system_config()
{
VERBOSE() << "AntiMicroX version: " << PadderCommon::programVersion
#ifdef ANTIMICROX_PKG_VERSION
<< " Package: " << ANTIMICROX_PKG_VERSION
#endif
#ifdef QT_DEBUG
<< " Type: Debug"
#else
<< " Type: Release"
#endif
;
VERBOSE() << "SDL version: " << PadderCommon::sdlVersionUsed << " (Compiled with: " << PadderCommon::sdlVersionCompiled
<< ")";
VERBOSE() << QString("Host OS: %1 Version: %2 Architecture: %3")
.arg(QSysInfo::productType(), QSysInfo::productVersion(), QSysInfo::currentCpuArchitecture());
}

int main(int argc, char *argv[])
{
qInstallMessageHandler(Logger::loggerMessageHandler);
Expand Down Expand Up @@ -265,18 +283,6 @@ int main(int argc, char *argv[])
}
settings.importFromCommandLine(cmdutility);
settings.applySettingsToLogger(cmdutility, appLogger);
VERBOSE() << "AntiMicroX version: " << PadderCommon::programVersion
#ifdef ANTIMICROX_PKG_VERSION
<< " Package: " << ANTIMICROX_PKG_VERSION
#endif
#ifdef QT_DEBUG
<< " Type: Debug"
#else
<< " Type: Release"
#endif
;
VERBOSE() << "SDL version: " << PadderCommon::sdlVersionUsed << " (Compiled with: " << PadderCommon::sdlVersionCompiled
<< ")";

Q_INIT_RESOURCE(resources);

Expand All @@ -295,6 +301,7 @@ int main(int argc, char *argv[])
// In the future, there might be a reason to actually send
// messages to the QLocalServer.
QLocalSocket socket;
log_system_config();

if ((socket.serverName() == QString()))
{
Expand Down

0 comments on commit 50faa0b

Please sign in to comment.