chore: Explain use of new for all log outputters
This commit is contained in:
parent
220711c2d7
commit
0bca094fce
4 changed files with 7 additions and 5 deletions
|
|
@ -128,7 +128,7 @@ Log::Log(bool singleton)
|
||||||
|
|
||||||
// other initalization
|
// other initalization
|
||||||
m_maxPriority = g_defaultMaxPriority;
|
m_maxPriority = g_defaultMaxPriority;
|
||||||
insert(new ConsoleLogOutputter);
|
insert(new ConsoleLogOutputter); // NOSONAR -- Adopted by `Log`
|
||||||
|
|
||||||
if (singleton) {
|
if (singleton) {
|
||||||
s_log = this;
|
s_log = this;
|
||||||
|
|
|
||||||
|
|
@ -133,10 +133,10 @@ SystemLogger::SystemLogger(const char *title, bool blockConsole) : m_stop(NULL)
|
||||||
{
|
{
|
||||||
// redirect log messages
|
// redirect log messages
|
||||||
if (blockConsole) {
|
if (blockConsole) {
|
||||||
m_stop = new StopLogOutputter;
|
m_stop = new StopLogOutputter; // NOSONAR -- Adopted by `Log`
|
||||||
CLOG->insert(m_stop);
|
CLOG->insert(m_stop);
|
||||||
}
|
}
|
||||||
m_syslog = new SystemLogOutputter;
|
m_syslog = new SystemLogOutputter; // NOSONAR -- Adopted by `Log`
|
||||||
m_syslog->open(title);
|
m_syslog->open(title);
|
||||||
CLOG->insert(m_syslog);
|
CLOG->insert(m_syslog);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ int App::daemonMainLoop(int, const char **)
|
||||||
void App::setupFileLogging()
|
void App::setupFileLogging()
|
||||||
{
|
{
|
||||||
if (argsBase().m_logFile != NULL) {
|
if (argsBase().m_logFile != NULL) {
|
||||||
m_fileLog = new FileLogOutputter(argsBase().m_logFile);
|
m_fileLog = new FileLogOutputter(argsBase().m_logFile); // NOSONAR -- Adopted by `Log`
|
||||||
CLOG->insert(m_fileLog);
|
CLOG->insert(m_fileLog);
|
||||||
LOG((CLOG_DEBUG1 "logging to file (%s) enabled", argsBase().m_logFile));
|
LOG((CLOG_DEBUG1 "logging to file (%s) enabled", argsBase().m_logFile));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ IpcLogOutputter::IpcLogOutputter(IpcServer &ipcServer, IpcClientType clientType,
|
||||||
m_runningMutex(ARCH->newMutex())
|
m_runningMutex(ARCH->newMutex())
|
||||||
{
|
{
|
||||||
if (useThread) {
|
if (useThread) {
|
||||||
m_bufferThread = new Thread(new TMethodJob<IpcLogOutputter>(this, &IpcLogOutputter::bufferThread));
|
const auto outputter =
|
||||||
|
new TMethodJob<IpcLogOutputter>(this, &IpcLogOutputter::bufferThread); // NOSONAR -- Adopted by `Log`
|
||||||
|
m_bufferThread = new Thread(outputter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue