Skip to content

Commit

Permalink
Logger.report() should handle LocalizedError, DecodingError, an…
Browse files Browse the repository at this point in the history
…d `EncodingError` identically to other errors (#3068)

* Update Logger+Report.swift
* Update test.yml
  • Loading branch information
MahdiBM committed Sep 20, 2023
1 parent 9b9de0d commit b70d504
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-docs.yml
Expand Up @@ -11,4 +11,4 @@ jobs:
with:
package_name: vapor
modules: Vapor,XCTVapor
pathsToInvalidate: /vapor /xctvapor
pathsToInvalidate: /vapor/* /xctvapor/*
11 changes: 0 additions & 11 deletions .github/workflows/projectboard.yml

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Expand Up @@ -23,14 +23,14 @@ jobs:
- provider: vapor/apns
ref: 3.0.0
runs-on: ubuntu-latest
container: swift:5.8-jammy
container: swift:5.9-jammy
steps:
- name: Check out Vapor
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: vapor
- name: Check out provider
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ matrix.provider }}
path: provider
Expand All @@ -45,6 +45,4 @@ jobs:
unit-tests:
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main
with:
with_coverage: true
with_tsan: false
with_public_api_check: true
14 changes: 1 addition & 13 deletions Sources/Vapor/Logging/Logger+Report.swift
Expand Up @@ -28,24 +28,12 @@ extension Logger {
reason = abort.reason
source = nil
level = .warning
case let encoding as EncodingError:
reason = "\(encoding)"
source = nil
level = .warning
case let decoding as DecodingError:
reason = "\(decoding)"
source = nil
level = .warning
case let localized as LocalizedError:
reason = localized.localizedDescription
source = nil
level = .warning
default:
reason = String(reflecting: error)
source = nil
level = .warning
}

self.log(
level: level,
.init(stringLiteral: reason),
Expand Down

0 comments on commit b70d504

Please sign in to comment.