refactor(log): Remove LOG_NOTE, use LOG_INFO for all previous notes

BREAKING_CHANGE: LOG Levels maybe wrong when starting the app
This commit is contained in:
sithlord48 2026-05-08 20:27:37 -04:00 committed by Nick Bolton
parent 52469072de
commit b198681311
24 changed files with 41 additions and 105 deletions

View file

@ -144,7 +144,7 @@ void DaemonApp::connectIpcServer(const ipc::DaemonIpcServer *ipcServer) const
void DaemonApp::run(QThread &daemonThread)
{
LOG_NOTE("starting daemon");
LOG_INFO("starting daemon");
// Important: Move the daemon app to the daemon thread before creating any more Qt objects
// owned by the daemon app, as they will be created on the daemon thread.

View file

@ -37,10 +37,6 @@ void ArchLogUnix::writeLog(LogLevel level, const QString &msg)
priority = LOG_WARNING;
break;
case Note:
priority = LOG_NOTICE;
break;
case Info:
priority = LOG_INFO;
break;

View file

@ -24,10 +24,10 @@
const int kPriorityPrefixLength = 3;
// names of priorities
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "NOTE", "INFO", "DEBUG", "DEBUG1", "DEBUG2"};
static const char *g_priority[] = {"FATAL", "ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2"};
// number of priorities
static const int g_numPriority = 8;
static const int g_numPriority = 7;
// if NDEBUG (not debug) is not specified, i.e. you're building in debug,
// then set default log level to DEBUG, otherwise the max level is INFO.

View file

@ -205,17 +205,15 @@ otherwise it expands to a call that doesn't.
#define CLOG_TAG_CRIT "%z\060" // char is '0'
#define CLOG_TAG_ERR "%z\061"
#define CLOG_TAG_WARN "%z\062"
#define CLOG_TAG_NOTE "%z\063"
#define CLOG_TAG_INFO "%z\064"
#define CLOG_TAG_DEBUG "%z\065"
#define CLOG_TAG_DEBUG1 "%z\066"
#define CLOG_TAG_DEBUG2 "%z\067"
#define CLOG_TAG_INFO "%z\063"
#define CLOG_TAG_DEBUG "%z\064"
#define CLOG_TAG_DEBUG1 "%z\065"
#define CLOG_TAG_DEBUG2 "%z\066"
#define CLOG_PRINT CLOG_TRACE CLOG_TAG_PRINT
#define CLOG_CRIT CLOG_TRACE CLOG_TAG_CRIT
#define CLOG_ERR CLOG_TRACE CLOG_TAG_ERR
#define CLOG_WARN CLOG_TRACE CLOG_TAG_WARN
#define CLOG_NOTE CLOG_TRACE CLOG_TAG_NOTE
#define CLOG_INFO CLOG_TRACE CLOG_TAG_INFO
#define CLOG_DEBUG CLOG_TRACE CLOG_TAG_DEBUG
#define CLOG_DEBUG1 CLOG_TRACE CLOG_TAG_DEBUG1
@ -225,7 +223,6 @@ otherwise it expands to a call that doesn't.
#define LOG_CRIT(...) LOG((CLOG_CRIT __VA_ARGS__))
#define LOG_ERR(...) LOG((CLOG_ERR __VA_ARGS__))
#define LOG_WARN(...) LOG((CLOG_WARN __VA_ARGS__))
#define LOG_NOTE(...) LOG((CLOG_NOTE __VA_ARGS__))
#define LOG_INFO(...) LOG((CLOG_INFO __VA_ARGS__))
#define LOG_DEBUG(...) LOG((CLOG_DEBUG __VA_ARGS__))
#define LOG_DEBUG1(...) LOG((CLOG_DEBUG1 __VA_ARGS__))

View file

@ -17,7 +17,6 @@ enum class LogLevel
Fatal, //!< For fatal errors
Error, //!< For serious errors
Warning, //!< For minor errors and warnings
Note, //!< For messages about notable events
Info, //!< For informational messages
Debug, //!< For important debugging messages
Debug1, //!< For verbosity +1 debugging messages

View file

@ -294,7 +294,7 @@ void Client::setOptions(const OptionsList &options)
index++;
if (index != options.end()) {
if (!*index) {
LOG_NOTE("clipboard sharing disabled by server");
LOG_INFO("clipboard sharing disabled by server");
}
m_enableClipboard = *index;
}
@ -308,7 +308,7 @@ void Client::setOptions(const OptionsList &options)
if (m_enableClipboard && !m_maximumClipboardSize) {
m_enableClipboard = false;
LOG_NOTE("clipboard sharing is disabled because the server set the maximum clipboard size to 0");
LOG_INFO("clipboard sharing is disabled because the server set the maximum clipboard size to 0");
}
m_screen->setOptions(options);
@ -341,7 +341,7 @@ void Client::sendClipboard(ClipboardID id)
std::string data = clipboard.marshall();
if (data.size() >= m_maximumClipboardSize * 1024) {
LOG(
(CLOG_NOTE "skipping clipboard transfer because the clipboard"
(CLOG_INFO "skipping clipboard transfer because the clipboard"
" contents exceeds the %i MB size limit set by the server",
m_maximumClipboardSize / 1024)
);

View file

@ -335,7 +335,7 @@ ServerProxy::ConnectionResult ServerProxy::parseMessage(const uint8_t *code)
void ServerProxy::handleKeepAliveAlarm()
{
LOG_NOTE("server is dead");
LOG_INFO("server is dead");
m_client->disconnect("server is not responding");
}

View file

@ -194,7 +194,6 @@ private:
QStringLiteral("FATAL")
, QStringLiteral("ERROR")
, QStringLiteral("WARNING")
, QStringLiteral("NOTE")
, QStringLiteral("INFO")
, QStringLiteral("DEBUG")
, QStringLiteral("DEBUG1")

View file

@ -58,7 +58,7 @@ App::~App()
void App::run(QThread &coreThread)
{
LOG_NOTE("starting core");
LOG_INFO("starting core");
// Important: Move the daemon app to the daemon thread before creating any more Qt objects
// owned by the daemon app, as they will be created on the daemon thread.

View file

@ -87,7 +87,7 @@ void ClientApp::parseArgs()
bye(s_exitFailed);
}
LOG_NOTE("configured %zu server address(es)", static_cast<size_t>(m_serverAddresses.size()));
LOG_INFO("configured %zu server address(es)", static_cast<size_t>(m_serverAddresses.size()));
}
}
@ -280,7 +280,7 @@ bool ClientApp::startClient()
clientScreen
);
m_clientScreen = clientScreen;
LOG_NOTE("started client");
LOG_INFO("started client");
}
m_client->setServerAddress(getCurrentServerAddress());
@ -332,7 +332,7 @@ int ClientApp::mainLoop()
// close down
LOG_DEBUG("stopping client");
stopClient();
LOG_NOTE("stopped client");
LOG_INFO("stopped client");
return exitCode;
}

View file

@ -90,7 +90,7 @@ void ServerApp::reloadConfig()
if (m_server != nullptr) {
m_server->setConfig(*m_config);
}
LOG_NOTE("reloaded configuration");
LOG_INFO("reloaded configuration");
}
}
@ -546,7 +546,7 @@ int ServerApp::mainLoop()
getEvents()->removeHandler(EventTypes::ServerAppForceReconnect, getEvents()->getSystemTarget());
getEvents()->removeHandler(EventTypes::ServerAppReloadConfig, getEvents()->getSystemTarget());
cleanupServer();
LOG_NOTE("stopped server");
LOG_INFO("stopped server");
return exitCode;
}

View file

@ -203,11 +203,10 @@ void SettingsDialog::updateText()
ui->comboLogLevel->setItemData(0, tr("Required messages"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(1, tr("Non-fatal errors"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(2, tr("General warnings"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(3, tr("Notable events"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(4, tr("General events [Default]"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(5, tr("Debug entries"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(6, tr("More debug output"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(7, tr("Verbose debug output"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(3, tr("General events [Default]"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(4, tr("Debug entries"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(5, tr("More debug output"), Qt::ToolTipRole);
ui->comboLogLevel->setItemData(6, tr("Verbose debug output"), Qt::ToolTipRole);
ui->buttonBox->button(QDialogButtonBox::Save)->setToolTip(tr("Close and save changes"));
ui->buttonBox->button(QDialogButtonBox::Cancel)->setToolTip(tr("Close and forget changes"));
ui->buttonBox->button(QDialogButtonBox::Reset)->setToolTip(tr("Reset to stored values"));
@ -286,7 +285,7 @@ void SettingsDialog::loadFromConfig()
ui->rbCloseToTray->setChecked(closeToTray);
ui->rbExitOnClose->setChecked(!closeToTray);
ui->lblDebugWarning->setVisible(Settings::value(Settings::Log::Level).toInt() > 4);
ui->lblDebugWarning->setVisible(Settings::value(Settings::Log::Level).toInt() > 3);
ui->comboInterface->setCurrentText(Settings::value(Settings::Core::Interface).toString());
if (ui->comboInterface->currentIndex() <= 0) {
@ -411,7 +410,7 @@ void SettingsDialog::updateRequestedKeySize() const
void SettingsDialog::logLevelChanged()
{
ui->lblDebugWarning->setVisible(ui->comboLogLevel->currentIndex() > 4);
ui->lblDebugWarning->setVisible(ui->comboLogLevel->currentIndex() > 3);
}
bool SettingsDialog::isModified() const

View file

@ -316,11 +316,6 @@
<string>Warning</string>
</property>
</item>
<item>
<property name="text">
<string>Note</string>
</property>
</item>
<item>
<property name="text">
<string>Info</string>

View file

@ -155,7 +155,7 @@ void ClientListener::handleClientConnecting()
void ClientListener::handleClientAccepted(IDataSocket *socket)
{
LOG_NOTE("accepted client connection");
LOG_INFO("accepted client connection");
// filter socket messages, including a packetizing filter
deskflow::IStream *stream = new PacketStreamFilter(m_events, socket, false);

View file

@ -245,18 +245,18 @@ void ClientProxyUnknown::handleData()
void ClientProxyUnknown::handleWriteError()
{
LOG_NOTE("error communicating with new client");
LOG_INFO("error communicating with new client");
sendFailure();
}
void ClientProxyUnknown::handleTimeout()
{
LOG_NOTE("new client is unresponsive");
LOG_INFO("new client is unresponsive");
sendFailure();
}
void ClientProxyUnknown::handleDisconnect()
{
LOG_NOTE("new client disconnected");
LOG_INFO("new client disconnected");
sendFailure();
}

View file

@ -133,10 +133,10 @@ Server::Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Scr
// Determine if scroll lock is already set. If so, lock the cursor to the
// primary screen (unless the user has disabled lock to screen in config)
if (!m_disableLockToScreen && (m_primaryClient->getToggleMask() & KeyModifierScrollLock)) {
LOG_NOTE("scroll lock is on, locking cursor to screen");
LOG_INFO("scroll lock is on, locking cursor to screen");
m_lockedToScreen = true;
} else if (m_defaultLockToScreenState) {
LOG_NOTE("default screen lock is on, locking cursor to screen");
LOG_INFO("default screen lock is on, locking cursor to screen");
m_lockedToScreen = true;
}
}
@ -353,7 +353,7 @@ bool Server::isLockedToScreen() const
// locked if we say we're locked
if (isLockedToScreenServer()) {
if (!m_defaultLockToScreenState) {
LOG_NOTE("cursor is locked to screen, check scroll lock key");
LOG_INFO("cursor is locked to screen, check scroll lock key");
}
return true;
}
@ -1112,12 +1112,12 @@ void Server::processOptions()
} else if (id == kOptionClipboardSharing) {
m_enableClipboard = value;
if (!m_enableClipboard) {
LOG_NOTE("clipboard sharing is disabled");
LOG_INFO("clipboard sharing is disabled");
}
} else if (id == kOptionClipboardSharingSize) {
if (value <= 0) {
m_maximumClipboardSize = 0;
LOG_NOTE(
LOG_INFO(
"clipboard sharing is disabled because the "
"maximum shared clipboard size is set to 0"
);
@ -1308,7 +1308,7 @@ void Server::handleClientDisconnected(BaseClientProxy *client)
void Server::handleClientCloseTimeout(BaseClientProxy *client)
{
// client took too long to disconnect. just dump it.
LOG_NOTE("forced disconnection of client \"%s\"", getName(client).c_str());
LOG_INFO("forced disconnection of client \"%s\"", getName(client).c_str());
removeOldClient(client);
delete client;
@ -1432,7 +1432,7 @@ void Server::handleLockCursorToScreenEvent(const Event &event)
// enter new state
if (newState != m_lockedToScreen) {
m_lockedToScreen = newState;
LOG_NOTE("cursor %s current screen", m_lockedToScreen ? "locked to" : "unlocked from");
LOG_INFO("cursor %s current screen", m_lockedToScreen ? "locked to" : "unlocked from");
m_primaryClient->reconfigure(getActivePrimarySides());
if (!isLockedToScreenServer()) {
@ -1459,7 +1459,7 @@ void Server::onClipboardChanged(const BaseClientProxy *sender, ClipboardID id, u
std::string data = clipboard.m_clipboard.marshall();
if (data.size() > m_maximumClipboardSize * 1024) {
LOG_NOTE(
LOG_INFO(
"not updating clipboard because it's over the size limit (%i KB) configured by the server",
m_maximumClipboardSize
);
@ -1961,7 +1961,7 @@ void Server::closeClient(BaseClientProxy *client, const char *msg)
// note that this method also works on clients that are not in
// the m_clients list. adoptClient() may call us with such a
// client.
LOG_NOTE("disconnecting client \"%s\"", getName(client).c_str());
LOG_INFO("disconnecting client \"%s\"", getName(client).c_str());
// send message
// FIXME -- avoid type cast (kinda hard, though)

View file

@ -12,7 +12,7 @@
#define LEVEL_PRINT "%z\057"
#define LEVEL_ERR "%z\061"
#define LEVEL_INFO "%z\064"
#define LEVEL_INFO "%z\063"
QString sanitizeBuffer(const std::stringstream &in)
{

View file

@ -106,11 +106,10 @@ void SettingsTests::checkLogLevels_Valid()
QCOMPARE(Settings::logLevelToInt(QStringLiteral("Fatal")), 0);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("erRor")), 1);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("wArning")), 2);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("notE")), 3);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("info")), 4);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("deBug")), 5);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("debuG1")), 6);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("dEbug2")), 7);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("info")), 3);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("deBug")), 4);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("debuG1")), 5);
QCOMPARE(Settings::logLevelToInt(QStringLiteral("dEbug2")), 6);
}
void SettingsTests::checkLogLevels_Invalid()

View file

@ -1161,10 +1161,6 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
<source>Warning</source>
<translation type="unfinished">Advertencia</translation>
</message>
<message>
<source>Note</source>
<translation type="unfinished">Nota</translation>
</message>
<message>
<source>Info</source>
<translation type="unfinished">Información</translation>
@ -1209,10 +1205,6 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU
<source>General warnings</source>
<translation type="unfinished">Advertencias generales</translation>
</message>
<message>
<source>Notable events</source>
<translation type="unfinished">Eventos notables</translation>
</message>
<message>
<source>General events [Default]</source>
<translation type="unfinished">Eventos generales [Predeterminado]</translation>

View file

@ -1161,10 +1161,6 @@ L&apos;abilitazione di questa impostazione disabiliterà l&apos;interfaccia graf
<source>Warning</source>
<translation>Avviso</translation>
</message>
<message>
<source>Note</source>
<translation>Nota</translation>
</message>
<message>
<source>Info</source>
<translation>Informazioni</translation>
@ -1209,10 +1205,6 @@ L&apos;abilitazione di questa impostazione disabiliterà l&apos;interfaccia graf
<source>General warnings</source>
<translation>Avvisi generali</translation>
</message>
<message>
<source>Notable events</source>
<translation>Eventi importanti</translation>
</message>
<message>
<source>General events [Default]</source>
<translation>Eventi generali [Predefinito]</translation>

View file

@ -1163,10 +1163,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>Warning</source>
<translation>警告</translation>
</message>
<message>
<source>Note</source>
<translation>通知</translation>
</message>
<message>
<source>Info</source>
<translation>情報</translation>
@ -1235,10 +1231,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>General warnings</source>
<translation>一般的な警告</translation>
</message>
<message>
<source>Notable events</source>
<translation>特筆すべき事象</translation>
</message>
<message>
<source>General events [Default]</source>
<translation>一般的な事象 [既定]</translation>

View file

@ -1161,10 +1161,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>Warning</source>
<translation>경고</translation>
</message>
<message>
<source>Note</source>
<translation>안내</translation>
</message>
<message>
<source>Info</source>
<translation>정보</translation>
@ -1233,10 +1229,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>General warnings</source>
<translation>일반 경고</translation>
</message>
<message>
<source>Notable events</source>
<translation>주요 이벤트</translation>
</message>
<message>
<source>General events [Default]</source>
<translation>일반 이벤트 [기본값]</translation>

View file

@ -1159,10 +1159,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>Warning</source>
<translation>Предупреждение</translation>
</message>
<message>
<source>Note</source>
<translation>Примечание</translation>
</message>
<message>
<source>Info</source>
<translation>Инфо</translation>
@ -1235,10 +1231,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>General warnings</source>
<translation>Общие предупреждения</translation>
</message>
<message>
<source>Notable events</source>
<translation>Важные события</translation>
</message>
<message>
<source>General events [Default]</source>
<translation>Общие события [По умолчанию]</translation>

View file

@ -1163,10 +1163,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>Warning</source>
<translation>警告</translation>
</message>
<message>
<source>Note</source>
<translation>注意</translation>
</message>
<message>
<source>Info</source>
<translation>信息</translation>
@ -1235,10 +1231,6 @@ Enabling this setting will disable the server config GUI.</source>
<source>General warnings</source>
<translation>一般警告</translation>
</message>
<message>
<source>Notable events</source>
<translation>值得注意的事件</translation>
</message>
<message>
<source>General events [Default]</source>
<translation>一般事件 [默认]</translation>