refactor: Rename param for Log::insert to make adoption clearer

This commit is contained in:
Nick Bolton
2025-02-28 12:26:27 +00:00
parent 0bca094fce
commit f56a3ba305
3 changed files with 14 additions and 19 deletions

View File

@ -11,9 +11,10 @@
"codesigning",
"Compat",
"contribs",
"daemonized",
"Daun",
"Devs",
"Deskflow",
"Devs",
"distro",
"distros",
"dmgbuild",
@ -48,6 +49,7 @@
"Oleksandr",
"Olena",
"outputdir",
"outputter",
"pacman",
"Petroules",
"Pixmap",

View File

@ -208,27 +208,18 @@ void Log::print(const char *file, int line, const char *fmt, ...)
}
}
void Log::insert(ILogOutputter *outputter, bool alwaysAtHead)
void Log::insert(ILogOutputter *adoptedOutputter, bool alwaysAtHead)
{
assert(outputter != NULL);
assert(adoptedOutputter != NULL);
ArchMutexLock lock(m_mutex);
if (alwaysAtHead) {
m_alwaysOutputters.push_front(outputter);
m_alwaysOutputters.push_front(adoptedOutputter);
} else {
m_outputters.push_front(outputter);
m_outputters.push_front(adoptedOutputter);
}
outputter->open(kAppName);
// Issue 41
// don't show log unless user requests it, as some users find this
// feature irritating (i.e. when they lose network connectivity).
// in windows the log window can be displayed by selecting "show log"
// from the deskflow system tray icon.
// if this causes problems for other architectures, then a different
// work around should be attempted.
// outputter->show(false);
adoptedOutputter->open(kAppName);
}
void Log::remove(ILogOutputter *outputter)

View File

@ -42,10 +42,12 @@ public:
//! @name manipulators
//@{
//! Add an outputter to the head of the list
//! Add an outputter to the head of the list and adopts it.
/*!
Inserts an outputter to the head of the outputter list. When the
logger writes a message, it goes to the outputter at the head of
Inserts an outputter to the head of the outputter list. The outputter
is deleted when Log destructor is called.
When the logger writes a message, it goes to the outputter at the head of
the outputter list. If that outputter's \c write() method returns
true then it also goes to the next outputter, as so on until an
outputter returns false or there are no more outputters. Outputters
@ -57,7 +59,7 @@ public:
By default, the logger has one outputter installed which writes to
the console.
*/
void insert(ILogOutputter *adopted, bool alwaysAtHead = false);
void insert(ILogOutputter *adoptedOutputter, bool alwaysAtHead = false);
//! Remove an outputter from the list
/*!