-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull v3 client into its own PR (#233)
* Pull v3 client into its own PR * Add tests * rename mls alpha * cleanup * bring back skip
- Loading branch information
Showing
6 changed files
with
237 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// URL.swift | ||
// | ||
// | ||
// Created by Pat Nakajima on 2/1/24. | ||
// | ||
|
||
import Foundation | ||
|
||
extension URL { | ||
static var documentsDirectory: URL { | ||
// swiftlint:disable no_optional_try | ||
guard let documentsDirectory = try? FileManager.default.url( | ||
for: .documentDirectory, | ||
in: .userDomainMask, | ||
appropriateFor: nil, | ||
create: false | ||
) else { | ||
fatalError("No documents directory") | ||
} | ||
|
||
return documentsDirectory | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Logger.swift | ||
// | ||
// | ||
// Created by Pat Nakajima on 8/28/23. | ||
// | ||
|
||
import Foundation | ||
import LibXMTP | ||
import os | ||
|
||
class XMTPLogger: FfiLogger { | ||
let logger = Logger() | ||
|
||
func log(level: UInt32, levelLabel: String, message: String) { | ||
switch level { | ||
case 1: | ||
logger.error("libxmtp[\(levelLabel)] - \(message)") | ||
case 2, 3: | ||
logger.info("libxmtp[\(levelLabel)] - \(message)") | ||
case 4: | ||
logger.debug("libxmtp[\(levelLabel)] - \(message)") | ||
case 5: | ||
logger.trace("libxmtp[\(levelLabel)] - \(message)") | ||
default: | ||
print("libxmtp[\(levelLabel)] - \(message)") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters