Logging Reference
-
LogCategoryFrom TealiumPrismCoreConstants for log categories used throughout the SDK.
Declaration
Swift
public enum LogCategory -
A protocol for handling log messages with different severity levels.
See moreDeclaration
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
See moreTealiumLogHandlerto log differently the data it receives (e.g.: Red color forerror, or more data fortracevsdebug) but it will always be used by a logger to compare it with theLogLevel.Minimumminimum log level and only send logs with higher severity than the configured minimum.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 moreDeclaration
Swift
public protocol LoggerProtocol -
The type of logger to use for handling log messages.
See moreDeclaration
Swift
public enum TealiumLoggerType -
Declaration
Swift
public extension OSSignpostIntervalState -
SignpostStateWrapperFrom TealiumPrismCoreA wrapper class to make the
OSSignpostIntervalStateeasier to use oniOS < 15.Declaration
Swift
public class SignpostStateWrapper -
A convenience class to use the
TealiumSignposterin an interval fashion that handles theSignpostStateWrapperinternally.This class will work correctly as long as you get exactly one
endcall after everybegin. 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:
See morelet signpostInterval = TealiumSignpostInterval(signposter: .networking, name: "HTTP Call Sent").begin("URL: \(request.url!)" session.dataTask(request) { _, response, _ in signpostInterval.end("Response \(response)") // handle request completion }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 < 15this class does nothing.For normal usecases of intervals being signposted you can use the
TealiumSignpostIntervalinstead 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
See morebeginIntervalname needs to match with theendIntervalname.Declaration
Swift
public class TealiumSignposter