Singleton class giving access to logging features.
More...
#include <logging_service.hh>
|
| LoggingService (void *ptr, bool takeRef=true) |
|
LINPHONECXX_PUBLIC _LinphoneLoggingService * | cPtr () |
|
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< LoggingServiceListener > &listener) |
|
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< LoggingServiceListener > &listener) |
|
LINPHONECXX_PUBLIC std::string | getDomain () |
| Get the domain where application logs are written (for example with message()). More...
|
|
LINPHONECXX_PUBLIC void | setDomain (const std::string &domain) |
| Set the domain where application logs are written (for example with message()). More...
|
|
LINPHONECXX_PUBLIC void | setLogLevel (linphone::LogLevel level) |
| Set the verbosity of the log. More...
|
|
LINPHONECXX_PUBLIC unsigned int | getLogLevelMask () const |
| Gets the log level mask. More...
|
|
LINPHONECXX_PUBLIC void | setLogLevelMask (unsigned int mask) |
| Sets the types of messages that will be authorized to be written in the log. More...
|
|
LINPHONECXX_PUBLIC void | debug (const std::string &message) |
| Write a LinphoneLogLevelDebug message to the logs. More...
|
|
LINPHONECXX_PUBLIC void | error (const std::string &message) |
| Write a LinphoneLogLevelError message to the logs. More...
|
|
LINPHONECXX_PUBLIC void | fatal (const std::string &message) |
| Write a LinphoneLogLevelFatal message to the logs. More...
|
|
LINPHONECXX_PUBLIC void | message (const std::string &message) |
| Write a LinphoneLogLevelMessage message to the logs. More...
|
|
LINPHONECXX_PUBLIC void | setLogFile (const std::string &dir, const std::string &filename, size_t maxSize) const |
| Enables logging in a file. More...
|
|
LINPHONECXX_PUBLIC void | trace (const std::string &message) |
| Write a LinphoneLogLevelTrace message to the logs. More...
|
|
LINPHONECXX_PUBLIC void | warning (const std::string &message) |
| Write a LinphoneLogLevelWarning message to the logs. More...
|
|
Singleton class giving access to logging features.
It supports custom domain, writing into a file as well as several verbosity levels. The LinphoneLoggingServiceCbs listener allows you to be notified each time a log is printed. As the LoggingService is a singleton, use get() to get it.
◆ debug()
LINPHONECXX_PUBLIC void linphone::LoggingService::debug |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelDebug message to the logs.
- Parameters
-
◆ error()
LINPHONECXX_PUBLIC void linphone::LoggingService::error |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelError message to the logs.
- Parameters
-
◆ fatal()
LINPHONECXX_PUBLIC void linphone::LoggingService::fatal |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelFatal message to the logs.
- Parameters
-
◆ get()
Gets the singleton logging service object.
The singleton is automatically instantiated if it hasn't been done yet.
- Returns
- A pointer on the LoggingService singleton.
◆ getDomain()
LINPHONECXX_PUBLIC std::string linphone::LoggingService::getDomain |
( |
| ) |
|
Get the domain where application logs are written (for example with message()).
- Returns
- The domain where application logs are written.
◆ getLogLevelMask()
LINPHONECXX_PUBLIC unsigned int linphone::LoggingService::getLogLevelMask |
( |
| ) |
const |
Gets the log level mask.
- Returns
- the log level mask
◆ message()
LINPHONECXX_PUBLIC void linphone::LoggingService::message |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelMessage message to the logs.
- Parameters
-
◆ setDomain()
LINPHONECXX_PUBLIC void linphone::LoggingService::setDomain |
( |
const std::string & |
domain | ) |
|
Set the domain where application logs are written (for example with message()).
- Parameters
-
- Note
- The domain is mandatory to write logs. This needs to be set before setting the log level.
◆ setLogFile()
LINPHONECXX_PUBLIC void linphone::LoggingService::setLogFile |
( |
const std::string & |
dir, |
|
|
const std::string & |
filename, |
|
|
size_t |
maxSize |
|
) |
| const |
Enables logging in a file.
That function enables an internal log handler that writes log messages in log-rotated files.
- Parameters
-
maxSize | The maximal size of each part of the log. The log rotating is triggered each time the currently opened log part reach that limit. |
◆ setLogLevel()
Set the verbosity of the log.
For instance, a level of LogLevel::Message will let pass fatal, error, warning and message-typed messages whereas trace and debug messages will be dumped out.
- Parameters
-
◆ setLogLevelMask()
LINPHONECXX_PUBLIC void linphone::LoggingService::setLogLevelMask |
( |
unsigned int |
mask | ) |
|
Sets the types of messages that will be authorized to be written in the log.
- Parameters
-
- Note
- Calling that function reset the log level that has been specified by setLogLevel().
◆ trace()
LINPHONECXX_PUBLIC void linphone::LoggingService::trace |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelTrace message to the logs.
- Parameters
-
◆ warning()
LINPHONECXX_PUBLIC void linphone::LoggingService::warning |
( |
const std::string & |
message | ) |
|
Write a LinphoneLogLevelWarning message to the logs.
- Parameters
-
The documentation for this class was generated from the following file: