Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix]Replace #file to #fileID #626

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/StreamVideo/Errors/Errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class ClientError: Error, CustomStringConvertible {
/// - error: an external error.
/// - file: a file name source of an error.
/// - line: a line source of an error.
public init(with error: Error? = nil, _ file: StaticString = #file, _ line: UInt = #line) {
public init(with error: Error? = nil, _ file: StaticString = #fileID, _ line: UInt = #line) {
underlyingError = error
location = .init(file: "\(file)", line: Int(line))
if let aErr = error as? APIError {
Expand All @@ -71,7 +71,7 @@ public class ClientError: Error, CustomStringConvertible {
/// - message: an error message.
/// - file: a file name source of an error.
/// - line: a line source of an error.
public init(_ message: String, _ file: StaticString = #file, _ line: UInt = #line) {
public init(_ message: String, _ file: StaticString = #fileID, _ line: UInt = #line) {
self.message = message
location = .init(file: "\(file)", line: Int(line))
underlyingError = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class StreamAudioSessionAdapter: NSObject, RTCAudioSessionDelegate, @unche
let configuration = RTCAudioSessionConfiguration.default
audioSession.updateConfiguration(
functionName: #function,
file: #file,
file: #fileID,
line: #line
) {
try $0.setConfiguration(.default)
Expand Down Expand Up @@ -242,7 +242,7 @@ final class StreamAudioSessionAdapter: NSObject, RTCAudioSessionDelegate, @unche

audioSession.updateConfiguration(
functionName: #function,
file: #file,
file: #fileID,
line: #line
) {
try $0.setMode(mode.rawValue)
Expand Down Expand Up @@ -271,7 +271,7 @@ final class StreamAudioSessionAdapter: NSObject, RTCAudioSessionDelegate, @unche
)
audioSession.updateConfiguration(
functionName: #function,
file: #file,
file: #fileID,
line: #line
) { try $0.setActive(isActive) }
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Utils/Logger/Array+Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension Array {
_ level: LogLevel,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line,
messageBuilder: ((Self) -> String)? = nil
) -> Self {
Expand Down
16 changes: 8 additions & 8 deletions Sources/StreamVideo/Utils/Logger/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public class Logger {
public func callAsFunction(
_ level: LogLevel,
functionName: StaticString = #function,
fileName: StaticString = #filePath,
fileName: StaticString = #fileID,
lineNumber: UInt = #line,
message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
Expand Down Expand Up @@ -332,7 +332,7 @@ public class Logger {
public func log(
_ level: LogLevel,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line,
message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
Expand Down Expand Up @@ -371,7 +371,7 @@ public class Logger {
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
log(
Expand All @@ -396,7 +396,7 @@ public class Logger {
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
log(
Expand All @@ -421,7 +421,7 @@ public class Logger {
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
log(
Expand All @@ -447,7 +447,7 @@ public class Logger {
subsystems: LogSubsystem = .other,
error: Error? = nil,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
log(
Expand All @@ -472,7 +472,7 @@ public class Logger {
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
guard !condition() else { return }
Expand All @@ -499,7 +499,7 @@ public class Logger {
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
if StreamRuntimeCheck.assertionsEnabled {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Utils/Logger/Publisher+Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ extension Publisher {
_ level: LogLevel,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line,
messageBuilder: ((Self.Output) -> String)? = nil
) -> Publishers.Log<Self> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension Publisher {
func nextValue(
dropFirst: Int = 0,
timeout: TimeInterval? = nil,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) async throws -> Output {
Expand Down
4 changes: 2 additions & 2 deletions Sources/StreamVideo/Utils/Unwrap/Unwrap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation
/// - errorMessage: A custom error message that will be used in the thrown
/// `ClientError` if the value is `nil`. The default is
/// `"Unavailable value"`.
/// - file: The file from which the function was called, using the `#file`
/// - file: The file from which the function was called, using the `#fileID`
/// directive to capture the source location. Default is the
/// calling file.
/// - line: The line number from which the function was called, using the
Expand All @@ -35,7 +35,7 @@ import Foundation
func unwrap<T>(
_ value: T?,
errorMessage: String = "Unavailable value",
file: StaticString = #file,
file: StaticString = #fileID,
line: UInt = #line
) throws -> T {
guard let value else {
Expand Down
4 changes: 2 additions & 2 deletions Sources/StreamVideo/WebRTC/v2/SFU/SFUAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ final class SFUAdapter: ConnectionStateDelegate, CustomStringConvertible, @unche
/// - line: The line from which we are requesting the publisher. Used for logging.
func publisher<T>(
eventType: T.Type,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) -> AnyPublisher<T, Never> {
Expand Down Expand Up @@ -575,7 +575,7 @@ final class SFUAdapter: ConnectionStateDelegate, CustomStringConvertible, @unche

private func statusCheck(
functionName: StaticString = #function,
filename: StaticString = #file,
filename: StaticString = #fileID,
lineNumber: UInt = #line
) {
guard !isConnected else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct WebRTCJoinRequestFactory {
subscriberSdp: String,
reconnectAttempt: UInt32,
publisher: RTCPeerConnectionCoordinator?,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) async -> Stream_Video_Sfu_Event_JoinRequest {
Expand Down Expand Up @@ -82,7 +82,7 @@ struct WebRTCJoinRequestFactory {
coordinator: WebRTCCoordinator,
reconnectAttempt: UInt32,
publisher: RTCPeerConnectionCoordinator?,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) async -> Stream_Video_Sfu_Event_ReconnectDetails? {
Expand Down Expand Up @@ -172,7 +172,7 @@ struct WebRTCJoinRequestFactory {
func buildAnnouncedTracks(
_ publisher: RTCPeerConnectionCoordinator?,
videoOptions: VideoOptions,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) -> [Stream_Video_Sfu_Models_TrackInfo] {
Expand Down Expand Up @@ -227,7 +227,7 @@ struct WebRTCJoinRequestFactory {
_ previousSessionID: String?,
coordinator: WebRTCCoordinator,
incomingVideoQualitySettings: IncomingVideoQualitySettings,
file: StaticString = #file,
file: StaticString = #fileID,
function: StaticString = #function,
line: UInt = #line
) async -> [Stream_Video_Sfu_Signal_TrackSubscriptionDetails] {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideo/WebRTC/v2/WebRTCStateAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ actor WebRTCStateAdapter: ObservableObject, StreamAudioSessionAdapterDelegate {
func enqueue(
_ operation: @escaping ParticipantOperation,
functionName: StaticString = #function,
fileName: StaticString = #file,
fileName: StaticString = #fileID,
lineNumber: UInt = #line
) {
/// Creates a new asynchronous task for the operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ extension ClientError {
}

public class EventDecoding: ClientError {
override init(_ message: String, _ file: StaticString = #file, _ line: UInt = #line) {
override init(_ message: String, _ file: StaticString = #fileID, _ line: UInt = #line) {
super.init(message, file, line)
}

init<T>(missingValue: String, for type: T.Type, _ file: StaticString = #file, _ line: UInt = #line) {
init<T>(missingValue: String, for type: T.Type, _ file: StaticString = #fileID, _ line: UInt = #line) {
super.init("`\(missingValue)` field can't be `nil` for the `\(type)` event.", file, line)
}
}
Expand Down