Skip to content

Commit f0a1a49

Browse files
committed
Clean up
1 parent 288ef4a commit f0a1a49

File tree

4 files changed

+0
-224
lines changed

4 files changed

+0
-224
lines changed

WireLogging/Sources/WireLogging/LogMessage/WireLogAttribute.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,4 @@ extension WireLogAttribute {
2727

2828
public typealias Provider = (String) -> WireLogAttribute
2929

30-
nonisolated(unsafe) public static let someKey: Provider = { .init(key: "someKey", value: $0) }
31-
3230
}
33-
34-
// TODO: delete
35-
nonisolated(unsafe) var la: [WireLogAttribute] = [
36-
.someKey("abcd")
37-
]

WireLogging/Sources/WireLogging/LogMessage/WireLogInterpolation.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,3 @@ public struct WireLogInterpolation: StringInterpolationProtocol {
5454
}
5555

5656
}
57-
58-
// TODO: remove this example
59-
// public struct SensibleInformationModel {
60-
// var content: String
61-
// }
62-
//
63-
// extension WireLogInterpolation {
64-
//
65-
// /// Construct the log message content for ``SensibleInformationModel`` values.
66-
// mutating func appendInterpolation(_ mySensibleInformation: SensibleInformationModel) {
67-
// let content: String
68-
// if isObfuscationRequired {
69-
// let obfuscatedContent = mySensibleInformation. ...
70-
// content = "SensibleInformationModel( \(obfuscatedContent) )"
71-
// } else {
72-
// content = "SensibleInformationModel( \(mySensibleInformation.content) )"
73-
// }
74-
// writeText(content)
75-
//
76-
// let relevantAttributes = ...
77-
// for relevantAttribute in relevantAttributes {
78-
// writeAttribute(relevantAttribute)
79-
// }
80-
// }
81-
// }

WireLogging/Tests/WireLoggingTests/WireLogMessage/WireLogInterpolation+anyErrorTests.swift

Lines changed: 0 additions & 153 deletions
This file was deleted.

WireLogging/Tests/WireLoggingTests/WireLogMessage/WireLogInterpolationTests.swift

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -32,45 +32,6 @@ struct WireLogInterpolationTests {
3232
let name = "World" as StaticString
3333
let message: WireLogMessage = "Hello, \(name)!"
3434
#expect(message.content == "Hello, World!")
35-
36-
let osl = OSLogHandler(subsystem: Bundle.main.bundleIdentifier!) // TODO: delete
37-
let l = WireTaggedLogger(tag: "test", handler: osl)
38-
l.critical("Lorem \("Ipsum")", .eventID("overridden")) x
39-
}
40-
41-
}
42-
43-
// TODO: move somewhere else? keep in readme/docs?
44-
private struct CustomType {
45-
var eventID = "012345"
46-
var sensibleInformation = "Sensitive"
47-
}
48-
49-
extension WireLogInterpolation {
50-
51-
fileprivate mutating func appendInterpolation(
52-
_ customType: CustomType,
53-
selfUserID: UUID
54-
) {
55-
56-
let obfuscationStartIndex = content.index(content.startIndex, offsetBy: 4)
57-
let obfuscatedContent = content.replacingCharacters(in: obfuscationStartIndex...content.endIndex, with: "***")
58-
writeText(obfuscatedContent)
59-
60-
writeAttribute(.eventID(selfUserID.uuidString))
61-
writeAttribute(.selfUserID(selfUserID.uuidString))
62-
}
63-
64-
}
65-
66-
extension WireLogAttribute {
67-
68-
fileprivate static func eventID(_ value: String) -> WireLogAttribute {
69-
.init(key: "event_id", value: value)
70-
}
71-
72-
fileprivate static func selfUserID(_ value: String) -> WireLogAttribute {
73-
.init(key: "self_user_id", value: value)
7435
}
7536

7637
}

0 commit comments

Comments
 (0)