Serialize the logger write method.
This commit is contained in:
2 files changed
+3
-1
No files matched your search
@@ -30,6 +30,7 @@ class Logger : NSObject, MP42Logging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func write(toLog string: String) {
|
func write(toLog string: String) {
|
||||||
|
queue.sync {
|
||||||
let output = "\(currentTime()) \(string)\n"
|
let output = "\(currentTime()) \(string)\n"
|
||||||
|
|
||||||
_ = fileURL.withUnsafeFileSystemRepresentation {
|
_ = fileURL.withUnsafeFileSystemRepresentation {
|
||||||
@@ -43,6 +44,7 @@ class Logger : NSObject, MP42Logging {
|
|||||||
delegate.write(toLog: output)
|
delegate.write(toLog: output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func writeError(toLog error: Error) {
|
func writeError(toLog error: Error) {
|
||||||
write(toLog: error.localizedDescription)
|
write(toLog: error.localizedDescription)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class MultiSelectViewController : NSViewController {
|
|||||||
if numberOfTracks == 1 {
|
if numberOfTracks == 1 {
|
||||||
label.stringValue = NSLocalizedString("1 track selected", comment: "")
|
label.stringValue = NSLocalizedString("1 track selected", comment: "")
|
||||||
} else {
|
} else {
|
||||||
label.stringValue = String(format: NSLocalizedString("%lu tracks selected", comment: ""), numberOfTracks)
|
label.stringValue = String.localizedStringWithFormat(NSLocalizedString("%lu tracks selected", comment: ""), numberOfTracks)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user