OAuth2Logger

public protocol OAuth2Logger

A simple protocol for loggers used in OAuth2.

The OAuth2DebugLogger is a simple implementation that logs to stdout. If you need more sophisticated logging, just adapt this protocol and set your logger on the OAuth2 instance you’re using.

  • The logger’s logging level.

    Declaration

    Swift

    var level: OAuth2LogLevel
  • trace(_:filename:line:function:msg:) Default implementation

    Log a message at the trace level.

    Default Implementation

    Log a message at the trace level.

    Declaration

    Swift

    func trace(_ module: String?, filename: String?, line: Int?, function: String?, msg: @autoclosure() -> String)
  • debug(_:filename:line:function:msg:) Default implementation

    Standard debug logging.

    Default Implementation

    Standard debug logging.

    Declaration

    Swift

    func debug(_ module: String?, filename: String?, line: Int?, function: String?, msg: @autoclosure() -> String)
  • warn(_:filename:line:function:msg:) Default implementation

    Log warning messages.

    Default Implementation

    Log warning messages.

    Declaration

    Swift

    func warn(_ module: String?, filename: String?, line: Int?, function: String?, msg: @autoclosure() -> String)
  • The main log method, figures out whether to log the given message based on the receiver’s logging level, then just uses print. Ignores filename, line and function.

    Declaration

    Swift

    public func log(_ atLevel: OAuth2LogLevel, module: String?, filename: String?, line: Int?, function: String?, msg: @autoclosure() -> String)