LoggingService

public class LoggingService : LinphoneObject

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.

  • Undocumented

    Declaration

    Swift

    public static func getSwiftObject(cObject: OpaquePointer) -> LoggingService
  • Undocumented

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Undocumented

    Declaration

    Swift

    public func addDelegate(delegate: LoggingServiceDelegate)
  • Undocumented

    Declaration

    Swift

    public func removeDelegate(delegate: LoggingServiceDelegate)
  • Gets the singleton logging service object. The singleton is automatically instantiated if it hasn’t been done yet.

    Declaration

    Swift

    public static var Instance: LoggingService { get }

    Return Value

    A pointer on the LoggingService singleton.

  • Returns the current callbacks being called while iterating on callbacks.

    Declaration

    Swift

    public var currentDelegate: LoggingServiceDelegate? { get }

    Return Value

    A pointer to the current LinphoneLoggingServiceCbs object

  • Set the domain where application logs are written (for example with message()).

    Note

    The domain is mandatory to write logs. This needs to be set before setting the log level. Get the domain where application logs are written (for example with message()).

    Declaration

    Swift

    public var domain: String { get set }

    Parameters

    domain

    The domain.

    Return Value

    The domain where application logs are written.

  • Set the verbosity of the log. For instance, a level of Message will let pass fatal, error, warning and message-typed messages whereas trace and debug messages will be dumped out.

    Declaration

    Swift

    public var logLevel: LogLevel? { get set }

    Parameters

    level

    the LogLevel to set

  • Sets the types of messages that will be authorized to be written in the log.

    Note

    Calling that function reset the log level that has been specified by setLogLevel(). Gets the log level mask.

    Declaration

    Swift

    public var logLevelMask: UInt { get set }

    Parameters

    mask

    Example: Message|Error will ONLY let pass message-typed and error messages.

    Return Value

    the log level mask

  • Write a LinphoneLogLevelDebug message to the logs.

    Declaration

    Swift

    public func debug(message: String)

    Parameters

    message

    The log message.

  • Write a LinphoneLogLevelError message to the logs.

    Declaration

    Swift

    public func error(message: String)

    Parameters

    message

    The log message.

  • Write a LinphoneLogLevelFatal message to the logs.

    Declaration

    Swift

    public func fatal(message: String)

    Parameters

    message

    The log message.

  • Write a LinphoneLogLevelMessage message to the logs.

    Declaration

    Swift

    public func message(message: String)

    Parameters

    message

    The log message.

  • Enables logging in a file. That function enables an internal log handler that writes log messages in log-rotated files.

    Declaration

    Swift

    public func setLogFile(dir: String, filename: String, maxSize: Int)

    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.

  • Write a LinphoneLogLevelTrace message to the logs.

    Declaration

    Swift

    public func trace(message: String)

    Parameters

    message

    The log message.

  • Write a LinphoneLogLevelWarning message to the logs.

    Declaration

    Swift

    public func warning(message: String)

    Parameters

    message

    The log message.