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 implementationLog 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 implementationStandard 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 implementationLog warning messages.
Default Implementation
Log warning messages.
Declaration
Swift
func warn(_ module: String?, filename: String?, line: Int?, function: String?, msg: @autoclosure() -> String)
-
log(_:module:filename:line:function:msg:)
Extension methodThe 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)