aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/Logging/Logger.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-13 18:00:29 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-13 18:00:32 +0530
commite199ed0d6c1ee89ff39c83193e945bfce5892777 (patch)
tree55a95cb47d2c6f2ef293da4ccb6fddbd0e12d543 /WireGuard/Shared/Logging/Logger.swift
parentLogging: Use ringlogger for logging from the app (diff)
downloadwireguard-apple-e199ed0d6c1ee89ff39c83193e945bfce5892777.tar.xz
wireguard-apple-e199ed0d6c1ee89ff39c83193e945bfce5892777.zip
Logging: Tag the entries in the merged log
So we know which entry is from the app and which is from the network extension. Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/Shared/Logging/Logger.swift')
-rw-r--r--WireGuard/Shared/Logging/Logger.swift10
1 files changed, 7 insertions, 3 deletions
diff --git a/WireGuard/Shared/Logging/Logger.swift b/WireGuard/Shared/Logging/Logger.swift
index bc0ffd4..9ba28a3 100644
--- a/WireGuard/Shared/Logging/Logger.swift
+++ b/WireGuard/Shared/Logging/Logger.swift
@@ -14,14 +14,18 @@ class Logger {
return (logPtr != nil)
}
- static func writeLog(mergedWith otherLogFile: String, to targetFile: String) -> Bool {
+ static func writeLog(mergedWith otherLogFile: String, tag: String, otherTag: String, to targetFile: String) -> Bool {
let otherlogPtr = otherLogFile.withCString { otherLogFileCStr -> UnsafeMutablePointer<log>? in
return open_log(otherLogFileCStr)
}
if let thisLogPtr = Logger.logPtr, let otherlogPtr = otherlogPtr {
return targetFile.withCString { targetFileCStr -> Bool in
- let returnValue = write_logs_to_file(targetFileCStr, thisLogPtr, otherlogPtr)
- return (returnValue == 0)
+ return tag.withCString { tagCStr -> Bool in
+ return otherTag.withCString { otherTagCStr -> Bool in
+ let returnValue = write_logs_to_file(targetFileCStr, tagCStr, thisLogPtr, otherTagCStr, otherlogPtr)
+ return (returnValue == 0)
+ }
+ }
}
}
return false