LogRecord

public struct LogRecord

Describes an event to be logged.

  • Creates a LogRecord.

    Declaration

    Swift

    public init(level: LogLevel,
                message: CustomStringConvertible,
                context: CustomStringConvertible?,
                timestamp: Date,
                file: String,
                function: String,
                line: Int)

    Parameters

    level

    the log level that reflects the importance of the event

    message

    a message describing this event

    context

    the context of the event, such as a session or connection identifier

    timestamp

    the timestamp of the event

    file

    the name of the file that logged the event

    function

    the name of the function that logged the event

    line

    the line number that logged the event

  • The log level that reflects the importance of the event.

    Declaration

    Swift

    public let level: LogLevel
  • A message describing this event.

    Declaration

    Swift

    public let message: CustomStringConvertible
  • The context of the event, such as a session or connection identifier.

    Declaration

    Swift

    public let context: CustomStringConvertible?
  • The timestamp of the event.

    Declaration

    Swift

    public let timestamp: Date
  • The name of the file that logged the event.

    Declaration

    Swift

    public let file: String
  • The name of the function that logged the event.

    Declaration

    Swift

    public let function: String
  • The line number that logged the event.

    Declaration

    Swift

    public let line: Int