Skip to content

Commit

Permalink
Addressed swiftlint warnings in Loggable.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
edorphy committed Jun 1, 2023
1 parent de8981f commit ffdb980
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Sources/Logging/Loggable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,15 @@ extension MXCallStackTree {
}

extension String.StringInterpolation {
// swiftlint:disable:next cyclomatic_complexity
mutating func appendInterpolation(exceptionType: Int32?) {
guard let exceptionType = exceptionType else {
appendLiteral("")
return
}

let literal: String

switch exceptionType {
case EXC_BAD_ACCESS:
literal = "EXC_BAD_ACCESS"
Expand Down Expand Up @@ -233,22 +234,23 @@ extension String.StringInterpolation {
literal = "EXC_GUARD"
case EXC_CORPSE_NOTIFY:
literal = "EXC_CORPSE_NOTIFY"

default:
literal = "\(exceptionType)"
}

appendLiteral(literal)
}


// swiftlint:disable:next cyclomatic_complexity function_body_length
mutating func appendInterpolation(signal: Int32?) {
guard let signal = signal else {
appendLiteral("")
return
}

let literal: String

switch signal {
case SIGHUP:
literal = "SIGHUP"
Expand Down Expand Up @@ -314,11 +316,11 @@ extension String.StringInterpolation {
literal = "SIGUSR1"
case SIGUSR2:
literal = "SIGUSR2"

default:
literal = "\(signal)"
}

self.appendLiteral(literal)
}
}
Expand Down

0 comments on commit ffdb980

Please sign in to comment.