diff --git a/DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift b/DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift index 961581b92c..f59bf755a3 100644 --- a/DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift +++ b/DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift @@ -14,7 +14,7 @@ extension StreamChatWrapper { } // Set the log level - LogConfig.level = .warning + LogConfig.level = StreamRuntimeCheck.logLevel ?? .warning LogConfig.formatters = [ PrefixLogFormatter(prefixes: [.info: "ℹī¸", .debug: "🛠", .warning: "⚠ī¸", .error: "🚨"]) ] diff --git a/DemoApp/StreamRuntimeCheck+StreamInternal.swift b/DemoApp/StreamRuntimeCheck+StreamInternal.swift index 5da00f0062..32de841931 100644 --- a/DemoApp/StreamRuntimeCheck+StreamInternal.swift +++ b/DemoApp/StreamRuntimeCheck+StreamInternal.swift @@ -9,4 +9,10 @@ extension StreamRuntimeCheck { static var isStreamInternalConfiguration: Bool { ProcessInfo.processInfo.environment["STREAM_DEV"] != nil } + + static var logLevel: LogLevel? { + guard let value = ProcessInfo.processInfo.environment["STREAM_LOG_LEVEL"] else { return nil } + guard let intValue = Int(value) else { return nil } + return LogLevel(rawValue: intValue) + } }