Serialize the logger write method.
This commit is contained in:
2 files changed
+12
-10
No files matched your search
+11
-9
@@ -30,17 +30,19 @@ class Logger : NSObject, MP42Logging {
|
||||
}
|
||||
|
||||
func write(toLog string: String) {
|
||||
let output = "\(currentTime()) \(string)\n"
|
||||
queue.sync {
|
||||
let output = "\(currentTime()) \(string)\n"
|
||||
|
||||
_ = fileURL.withUnsafeFileSystemRepresentation {
|
||||
if let file = fopen($0, "a") {
|
||||
fputs(output, file)
|
||||
fclose(file)
|
||||
_ = fileURL.withUnsafeFileSystemRepresentation {
|
||||
if let file = fopen($0, "a") {
|
||||
fputs(output, file)
|
||||
fclose(file)
|
||||
}
|
||||
}
|
||||
|
||||
if let delegate = delegate {
|
||||
delegate.write(toLog: output)
|
||||
}
|
||||
}
|
||||
|
||||
if let delegate = delegate {
|
||||
delegate.write(toLog: output)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class MultiSelectViewController : NSViewController {
|
||||
if numberOfTracks == 1 {
|
||||
label.stringValue = NSLocalizedString("1 track selected", comment: "")
|
||||
} 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