Logging

  • LogCategory From TealiumPrismCore

    Constants for log categories used throughout the SDK.

    Declaration

    Swift

    public enum LogCategory
  • A protocol for handling log messages with different severity levels.

    See more

    Declaration

    Swift

    public protocol LogHandler : AnyObject
  • The various levels of severity that can be attached to a single log.

    The higher the rawValue of the log level, the more important it is to be logged. The log level can be used by a TealiumLogHandler to log differently the data it receives (e.g.: Red color for error, or more data for trace vs debug) but it will always be used by a logger to compare it with the LogLevel.Minimum minimum log level and only send logs with higher severity than the configured minimum.

    See more

    Declaration

    Swift

    public enum LogLevel : Int, Comparable, CaseIterable, CustomStringConvertible
  • A central utility class for processing log statements at various log levels.

    Log messages are not guaranteed to be processed immediately upon calling one of the logging methods, however they will be processed in the order that they are received.

    Important: When using the logging methods, always use a limited set of non-dynamic categories. Categories should be static strings that identify the component or feature being logged (e.g., “NetworkModule”, “TraceModule”). Avoid using dynamic values like user IDs, timestamps, or other variable data as categories, as this can lead to performance issues and potential memory problems in logging implementations.

    See more

    Declaration

    Swift

    public protocol LoggerProtocol
  • The type of logger to use for handling log messages.

    See more

    Declaration

    Swift

    public enum TealiumLoggerType
  • Declaration

    Swift

    public extension OSSignpostIntervalState
  • SignpostStateWrapper From TealiumPrismCore

    A wrapper class to make the OSSignpostIntervalState easier to use on iOS < 15.

    Declaration

    Swift

    public class SignpostStateWrapper
  • A convenience class to use the TealiumSignposter in an interval fashion that handles the SignpostStateWrapper internally.

    This class will work correctly as long as you get exactly one end call after every begin. The suggested way to use this would be to create and begin a new interval everytime it’s needed and then end it once the interval is completed.

    Usage:

     let signpostInterval = TealiumSignpostInterval(signposter: .networking, name: "HTTP Call Sent").begin("URL: \(request.url!)"
     session.dataTask(request) { _, response, _ in
        signpostInterval.end("Response \(response)")
        // handle request completion
     }
    
    See more

    Declaration

    Swift

    public class TealiumSignpostInterval
  • A wrapper around the OSSignposter API to make it easier to use when supporting iOS < 15. Enable it by changing the enabled static flag on this class.

    On iOS < 15 this class does nothing.

    For normal usecases of intervals being signposted you can use the TealiumSignpostInterval instead of this class, so you can avoid handling the SignpostStateWrapper yourself. If instead you want to handle it yourself, or you have to send singular events, you can use this class like so:

     let signposter = TealiumSignposter("Networking")
     let state = signposter.beginInterval("Start Request", "\(request)")
     urlSession.dataTask(request) { _, response, _ in
          signposter.endInterval("Start Request", state: state, "\(response)")
          // Handle the HTTP response
     }
    

    Note that the beginInterval name needs to match with the endInterval name.

    See more

    Declaration

    Swift

    public class TealiumSignposter