Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #59 from nodes-vapor/feature/add-version
Browse files Browse the repository at this point in the history
Add optional version in reports
  • Loading branch information
siemensikkema authored Jul 31, 2019
2 parents 5d769f0 + 189820e commit 24a4e13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/Bugsnag/Bugsnag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct BugsnagUser: Encodable {

struct BugsnagApp: Encodable {
let releaseStage: String
let version: String?
}

struct BugsnagMetaData: Encodable {
Expand Down
4 changes: 4 additions & 0 deletions Sources/Bugsnag/BugsnagConfig.swift
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
public struct BugsnagConfig {
let apiKey: String
let releaseStage: String
/// A version identifier, (eg. a git hash)
let version: String?
let keyFilters: [String]
let shouldReport: Bool
let debug: Bool

public init(
apiKey: String,
releaseStage: String,
version: String? = nil,
keyFilters: [String] = [],
shouldReport: Bool = true,
debug: Bool = false
) {
self.apiKey = apiKey
self.releaseStage = releaseStage
self.version = version
self.keyFilters = keyFilters
self.shouldReport = shouldReport
self.debug = debug
Expand Down
3 changes: 2 additions & 1 deletion Sources/Bugsnag/BugsnagReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public struct BugsnagReporter: Service {
}

app = BugsnagApp(
releaseStage: config.releaseStage
releaseStage: config.releaseStage,
version: config.version
)
headers = .init([
("Content-Type", "application/json"),
Expand Down

0 comments on commit 24a4e13

Please sign in to comment.