aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-17 00:41:10 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-17 08:51:27 +0100
commita6f80135ef65f33da67459b56c7f659c64d6d341 (patch)
treefcfe4ec56bdcac07ad235e9db9a83a530fd0e576 /WireGuard/WireGuard
parentmacOS: Tunnel detail: Activate / Deactivate is now a button (diff)
downloadwireguard-apple-a6f80135ef65f33da67459b56c7f659c64d6d341.tar.xz
wireguard-apple-a6f80135ef65f33da67459b56c7f659c64d6d341.zip
ringlogger: support mpsc for singlefile
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/Base.lproj/Localizable.strings3
-rw-r--r--WireGuard/WireGuard/UI/iOS/AppDelegate.swift2
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift7
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift2
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift7
-rw-r--r--WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift2
6 files changed, 5 insertions, 18 deletions
diff --git a/WireGuard/WireGuard/Base.lproj/Localizable.strings b/WireGuard/WireGuard/Base.lproj/Localizable.strings
index 55610aaf..b42d40f3 100644
--- a/WireGuard/WireGuard/Base.lproj/Localizable.strings
+++ b/WireGuard/WireGuard/Base.lproj/Localizable.strings
@@ -188,9 +188,6 @@
"alertUnableToRemovePreviousLogTitle" = "Log export failed";
"alertUnableToRemovePreviousLogMessage" = "The pre-existing log could not be cleared";
-"alertUnableToFindExtensionLogPathTitle" = "Log export failed";
-"alertUnableToFindExtensionLogPathMessage" = "Unable to determine extension log path";
-
"alertUnableToWriteLogTitle" = "Log export failed";
"alertUnableToWriteLogMessage" = "Unable to write logs to file";
diff --git a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
index 8743c70d..d2742808 100644
--- a/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/iOS/AppDelegate.swift
@@ -11,7 +11,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var mainVC: MainViewController?
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
- Logger.configureGlobal(withFilePath: FileManager.appLogFileURL?.path)
+ Logger.configureGlobal(tagged: "APP", withFilePath: FileManager.logFileURL?.path)
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = .white
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
index 3addea46..ff83b2c0 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
@@ -126,12 +126,7 @@ class SettingsTableViewController: UITableViewController {
}
}
- guard let networkExtensionLogFilePath = FileManager.networkExtensionLogFileURL?.path else {
- ErrorPresenter.showErrorAlert(title: tr("alertUnableToFindExtensionLogPathTitle"), message: tr("alertUnableToFindExtensionLogPathMessage"), from: self)
- return
- }
-
- let isWritten = Logger.global?.writeLog(called: "APP", mergedWith: networkExtensionLogFilePath, called: "NET", to: destinationURL.path) ?? false
+ let isWritten = Logger.global?.writeLog(to: destinationURL.path) ?? false
DispatchQueue.main.async {
guard isWritten else {
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index cbe6153c..9f08e155 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -14,7 +14,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var manageTunnelsWindowObject: NSWindow?
func applicationDidFinishLaunching(_ aNotification: Notification) {
- Logger.configureGlobal(withFilePath: FileManager.appLogFileURL?.path)
+ Logger.configureGlobal(tagged: "APP", withFilePath: FileManager.logFileURL?.path)
TunnelsManager.create { [weak self] result in
guard let self = self else { return }
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
index 7f2dbc8b..8987f79d 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
@@ -198,17 +198,12 @@ class TunnelsListTableViewController: NSViewController {
let timeStampString = dateFormatter.string(from: Date())
savePanel.nameFieldStringValue = "wireguard-log-\(timeStampString).txt"
- guard let networkExtensionLogFilePath = FileManager.networkExtensionLogFileURL?.path else {
- ErrorPresenter.showErrorAlert(title: tr("alertUnableToFindExtensionLogPathTitle"), message: tr("alertUnableToFindExtensionLogPathMessage"), from: self)
- return
- }
-
savePanel.beginSheetModal(for: window) { response in
guard response == .OK else { return }
guard let destinationURL = savePanel.url else { return }
DispatchQueue.global(qos: .userInitiated).async {
- let isWritten = Logger.global?.writeLog(called: "APP", mergedWith: networkExtensionLogFilePath, called: "NET", to: destinationURL.path) ?? false
+ let isWritten = Logger.global?.writeLog(to: destinationURL.path) ?? false
guard isWritten else {
DispatchQueue.main.async { [weak self] in
ErrorPresenter.showErrorAlert(title: tr("alertUnableToWriteLogTitle"), message: tr("alertUnableToWriteLogMessage"), from: self)
diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift
index e33890df..c4fefd42 100644
--- a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift
+++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift
@@ -122,7 +122,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
}
private func configureLogger() {
- Logger.configureGlobal(withFilePath: FileManager.networkExtensionLogFileURL?.path)
+ Logger.configureGlobal(tagged: "NET", withFilePath: FileManager.logFileURL?.path)
wgSetLogger { level, msgC in
guard let msgC = msgC else { return }
let logType: OSLogType