Package org.linphone.core
Interface LoggingService
public interface LoggingService
Singleton class giving access to logging features.
It supports custom domain, writing into a file as well as several verbosity
levels. The
each time a log is printed.
As the
It supports custom domain, writing into a file as well as several verbosity
levels. The
LoggingServiceListener
listener allows you to be notifiedeach time a log is printed.
As the
LoggingService
is a singleton, use get()
to get it. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(LoggingServiceListener listener) void
Write a LinphoneLogLevelDebug message to the logs.void
Write a LinphoneLogLevelError message to the logs.void
Write a LinphoneLogLevelFatal message to the logs.get()
Gets the singleton logging service object.Get the domain where application logs are written (for example withmessage(java.lang.String)
).int
Gets the log level mask.long
Gets the native pointer used by this class to make native method calls.Gets the object stored in this object user's datavoid
Write a LinphoneLogLevelMessage message to the logs.void
removeListener
(LoggingServiceListener listener) void
Set the domain where application logs are written (for example withmessage(java.lang.String)
).void
setLogFile
(String dir, String filename, int maxSize) Enables logging in a file.void
setLogLevel
(LogLevel level) Set the verbosity of the log.void
setLogLevelMask
(int mask) Sets the types of messages that will be authorized to be written in the log.void
setStackTraceDumpsEnabled
(boolean enable) Allow Linphone to set handlers for catching exceptions and write the stack
trace into log.void
setUserData
(Object data) Sets the object to store in this object user's datatoString()
void
Write a LinphoneLogLevelTrace message to the logs.void
Write a LinphoneLogLevelWarning message to the logs.
-
Method Details
-
getDomain
- Returns:
- The domain where application logs are written.
-
setDomain
- Parameters:
domain
- The domain.
note: The domain is mandatory to write logs. This needs to be set before
setting the log level.
-
setLogLevel
Set the verbosity of the log.
For instance, a level ofLogLevel.Message
will let pass fatal, error,
warning and message-typed messages whereas trace and debug messages will be
dumped out.- Parameters:
level
- theLogLevel
to set
-
getLogLevelMask
int getLogLevelMask()Gets the log level mask.
- Returns:
- the log level mask
-
setLogLevelMask
void setLogLevelMask(int mask) Sets the types of messages that will be authorized to be written in the log.
- Parameters:
mask
- Example:LogLevel.Message
|LogLevel.Error
will ONLY
let pass message-typed and error messages.
note: Calling that function reset the log level that has been specified by
setLogLevel(org.linphone.core.LogLevel)
.
-
setStackTraceDumpsEnabled
void setStackTraceDumpsEnabled(boolean enable) Allow Linphone to set handlers for catching exceptions and write the stack
trace into log.
Available for Windows. It keeps old handlers.- Parameters:
enable
- if true global handlers will be prepend by the logger handlers.
By default, it is false.
-
debug
Write a LinphoneLogLevelDebug message to the logs.
- Parameters:
message
- The log message.
-
error
Write a LinphoneLogLevelError message to the logs.
- Parameters:
message
- The log message.
-
fatal
Write a LinphoneLogLevelFatal message to the logs.
- Parameters:
message
- The log message.
-
message
Write a LinphoneLogLevelMessage message to the logs.
- Parameters:
message
- The log message.
-
setLogFile
Enables logging in a file.
That function enables an internal log handler that writes log messages in
log-rotated files.- Parameters:
dir
- Directory where to create the distinct parts of the log.filename
- Name of the log file.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.
-
trace
Write a LinphoneLogLevelTrace message to the logs.
- Parameters:
message
- The log message.
-
warning
Write a LinphoneLogLevelWarning message to the logs.
- Parameters:
message
- The log message.
-
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.
-
addListener
-
removeListener
-
setUserData
Sets the object to store in this object user's data- Parameters:
data
- the object to store
-
getUserData
Object getUserData()Gets the object stored in this object user's data- Returns:
- the object store if any, null otherwise
-
getNativePointer
long getNativePointer()Gets the native pointer used by this class to make native method calls.- Returns:
- the nativer pointer, as long
-
toString
String toString()
-