session-ios/SessionUtilitiesKit/General/Logging.swift

20 lines
523 B
Swift
Raw Normal View History

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import Foundation
2021-10-05 06:45:54 +02:00
import SignalCoreKit
2020-11-05 02:07:21 +01:00
2020-11-05 02:15:57 +01:00
public func SNLog(_ message: String) {
let threadString: String = (Thread.isMainThread ? " Main" : "")
2020-11-05 02:07:21 +01:00
#if DEBUG
print("[Session\(threadString)] \(message)")
2020-11-05 02:07:21 +01:00
#endif
OWSLogger.info("[Session\(threadString)] \(message)")
2020-11-05 02:07:21 +01:00
}
public func SNLogNotTests(_ message: String) {
guard ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil else { return }
SNLog(message)
}