Skip to content

Commit

Permalink
Merge pull request #13125 from acolombier/chore/reduce-controler-noise
Browse files Browse the repository at this point in the history
Reduce log noise with HID device
  • Loading branch information
JoergAtGithub authored Apr 18, 2024
2 parents 6804af6 + 500ca5f commit 38bcfcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/controllers/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "controllers/scripting/legacy/controllerscriptenginelegacy.h"
#include "moc_controller.cpp"
#include "util/cmdlineargs.h"
#include "util/screensaver.h"

namespace {
Expand Down Expand Up @@ -129,7 +130,9 @@ void Controller::receive(const QByteArray& data, mixxx::Duration timestamp) {
triggerActivity();

int length = data.size();
if (m_logInput().isDebugEnabled()) {
if (CmdlineArgs::Instance()
.getControllerDebug() &&
m_logInput().isDebugEnabled()) {
// Formatted packet display
QString message = QString("t:%2, %3 bytes:\n")
.arg(timestamp.formatMillisWithUnit(),
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/hid/hidioglobaloutputreportfifo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <hidapi.h>

#include "controllers/hid/hiddevice.h"
#include "util/cmdlineargs.h"
#include "util/compatibility/qmutex.h"
#include "util/runtimeloggingcategory.h"
#include "util/string.h"
Expand Down Expand Up @@ -77,7 +78,7 @@ bool HidIoGlobalOutputReportFifo::sendNextReportDataset(QMutex* pHidDeviceAndPol

hidDeviceLock.unlock();

if (result != -1) {
if (result != -1 && CmdlineArgs::Instance().getControllerDebug()) {
qCDebug(logOutput) << "t:" << startOfHidWrite.formatMillisWithUnit()
<< " " << result << "bytes (including ReportID of"
<< static_cast<quint8>(reportToSend[0])
Expand Down

0 comments on commit 38bcfcc

Please sign in to comment.