gloox
1.0.27
src
logsink.cpp
1
/*
2
Copyright (c) 2005-2023 by Jakob Schröter <js@camaya.net>
3
This file is part of the gloox library. http://camaya.net/gloox
4
5
This software is distributed under a license. The full license
6
agreement can be found in the file LICENSE in this distribution.
7
This software may not be copied, modified, sold or distributed
8
other than expressed in the named license agreement.
9
10
This software is distributed without any warranty.
11
*/
12
13
14
15
#include "logsink.h"
16
17
namespace
gloox
18
{
19
20
LogSink::LogSink
()
21
{
22
}
23
24
LogSink::~LogSink
()
25
{
26
}
27
28
void
LogSink::log
(
LogLevel
level,
LogArea
area,
const
std::string& message )
const
29
{
30
LogHandlerMap::const_iterator it = m_logHandlers.begin();
31
for
( ; it != m_logHandlers.end(); ++it )
32
{
33
if
( (*it).first && ( (*it).second.level <= level ) && ( (*it).second.areas & area ) )
34
(*it).first->handleLog( level, area, message );
35
}
36
}
37
38
void
LogSink::registerLogHandler
(
LogLevel
level,
int
areas,
LogHandler
* lh )
39
{
40
LogInfo info = { level, areas };
41
m_logHandlers[lh] = info;
42
}
43
44
void
LogSink::removeLogHandler
(
LogHandler
* lh )
45
{
46
m_logHandlers.erase( lh );
47
}
48
49
}
gloox::LogHandler
A virtual interface which can be reimplemented to receive debug and log messages.
Definition
loghandler.h:34
gloox::LogSink::registerLogHandler
void registerLogHandler(LogLevel level, int areas, LogHandler *lh)
Definition
logsink.cpp:38
gloox::LogSink::removeLogHandler
void removeLogHandler(LogHandler *lh)
Definition
logsink.cpp:44
gloox::LogSink::LogSink
LogSink()
Definition
logsink.cpp:20
gloox::LogSink::~LogSink
virtual ~LogSink()
Definition
logsink.cpp:24
gloox::LogSink::log
void log(LogLevel level, LogArea area, const std::string &message) const
Definition
logsink.cpp:28
gloox
The namespace for the gloox library.
Definition
adhoc.cpp:28
gloox::LogArea
LogArea
Definition
gloox.h:1053
gloox::LogLevel
LogLevel
Definition
gloox.h:1080
Generated on Sun Jul 16 2023 08:45:24 for gloox by
1.9.8