LogRecord

public struct LogRecord

LogRecord objects are used to pass logging requests between the logging framework and individual log Handlers.

  • the name of the logger that logged this record.

    Declaration

    Swift

    public let loggerName: String
  • Represents the chosen log level for this log.

    Declaration

    Swift

    public let logLevel: LogLevel
  • Point in time where this log got created.

    Declaration

    Swift

    public let date: Date
  • The message provided by the one who wants to log something.

    Declaration

    Swift

    public let logMessage: String
  • The name of the function where the logging was triggered

    Declaration

    Swift

    public let function: String
  • The name and path of the file where logging was triggered

    Declaration

    Swift

    public let file: String
  • The line in the file where logging was triggered

    Declaration

    Swift

    public let line: Int
  • Error which occured passed to the logging framework, might be nil

    Declaration

    Swift

    public let error: Error?
  • Thread name where the logging was triggered

    Declaration

    Swift

    public let thread: String
  • GUID that describes one request/response flow

    Declaration

    Swift

    public let correlationId: String?
  • Construct a LogRecord with the given parameters.

    Declaration

    Swift

    public init(loggerName: String, logLevel: LogLevel, date: Date, logMessage: String, function: String, file: String, line: Int, error: Error?, thread: String, correlationId: String? = nil)

    Parameters

    logLevel

    Represents the chosen log level for this log.

    date

    Point in time where this log got created.

    logMessage

    The message provided by the one who wants to log something.

    function

    The name of the function where the logging was triggered

    file

    The name of the file where logging was triggered

    line

    The line in the file where logging was triggered

    error

    Error which occured passed to the logging framework, might be nil

    thread

    Thread name where the logging was triggered

    correlationId

    Optional parameter. GUID that describes one request/response flow.