diff --git a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift index cb0ee9c..86047d0 100644 --- a/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift +++ b/MVMCore/MVMCore/OtherHandlers/MVMCoreLoggingHandler.swift @@ -49,6 +49,11 @@ import os @objc open func handleDebugMessage(_ message: String?) { #if LOGGING guard let message = message else { return } + guard message.count < 1024 else { + logger.debug("\(message.prefix(100), privacy: .public)... ") // Send initial log to console. + print(message) // Print the whole on stdout. + return + } logger.debug("\(message, privacy: .public)") // Assume that becaues this is a LOGGING build we want these messages to be unmasked. // TODO: How do we split the messaging by Library and Subsystem? #endif @@ -56,6 +61,11 @@ import os open func handleDebugMessage(_ message: String, category: String?) { #if LOGGING + guard message.count < 1024 else { + getLogger(category: category).debug("\(message.prefix(100), privacy: .public)... ") // Send initial log to console. + print(message) // Print the whole on stdout. + return + } getLogger(category: category).debug("\(message, privacy: .public)") // Assume that becaues this is a LOGGING build we want these messages to be unmasked. #endif }