XcodeLogConfiguration

open class XcodeLogConfiguration: ConsoleLogConfiguration

A LogConfiguration optimized for use when running within Xcode.

  • Initializes a new XcodeLogConfiguration instance.

    Warning

    Setting either debugMode or verboseDebugMode to true will result in synchronousMode being used when recording log entries. Synchronous mode is helpful while debugging, as it ensures that logs are always up-to-date when debug breakpoints are hit. However, synchronous mode can have a negative influence on performance and is therefore not recommended for use in production code.

    Declaration

    Swift

    public init(minimumSeverity: LogSeverity = .info, debugMode: Bool = false, verboseDebugMode: Bool = false, stdStreamsMode: StandardStreamsMode = .useAsFallback, mimicOSLogOutput: Bool = true, showCallSite: Bool = true, filters: [LogFilter] = [])

    Parameters

    minimumSeverity

    The minimum supported LogSeverity. Any LogEntry having a severity less than minimumSeverity will be silently ignored.

    debugMode

    If true, the value of minimumSeverity will be lowered (if necessary) to .debug and synchronousMode will be used when recording log entries.

    verboseDebugMode

    If true, the value of minimumSeverity will be lowered (if necessary) to .verbose and synchronousMode will be used when recording log entries.

    stdStreamsMode

    A StandardStreamsMode value that governs when standard console streams (i.e., stdout and stderr) should be used for recording log output.

    mimicOSLogOutput

    If true, any output sent to stdout will be formatted in such a way as to mimic the output seen when os_log() is used.

    showCallSite

    If true, the source file and line indicating the call site of the log request will be added to formatted log messages.

    filters

    The LogFilters to use when deciding whether a given LogEntry should be passed along for recording.