27 lines
693 B
Swift
27 lines
693 B
Swift
import Foundation
|
||
|
||
/// Public logging utility for the SecureStorage workspace.
|
||
public enum Logger {
|
||
public static var isLoggingEnabled = true
|
||
|
||
public static func debug(_ message: String) {
|
||
#if DEBUG
|
||
if isLoggingEnabled {
|
||
print(" {SECURE_STORAGE} ℹ️ \(message)")
|
||
}
|
||
#endif
|
||
}
|
||
|
||
public static func error(_ message: String, error: Error? = nil) {
|
||
#if DEBUG
|
||
var logMessage = " {SECURE_STORAGE} ❌ \(message)"
|
||
if let error = error {
|
||
logMessage += " | Error: \(error.localizedDescription)"
|
||
}
|
||
if isLoggingEnabled {
|
||
print(logMessage)
|
||
}
|
||
#endif
|
||
}
|
||
}
|