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.

  • Declaration

    Swift

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

    Swift

    public var getCobject: OpaquePointer? { get }
  • Declaration

    Swift

    public func addDelegate(delegate: LoggingServiceDelegate)
  • 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 }

    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 }

    Return Value

    the log level mask

  • Allow Linphone to set handlers for catching exceptions and write the stack trace into log. Available for Windows. It keeps old handlers.

    Declaration

    Swift

    public var stackTraceDumpsEnabled: Bool? { get set }

    Parameters

    enable

    if true global handlers will be prepend by the logger handlers. By default, it is false.

  • 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.