Digital PCT265 story ONEAPP-7249 - Pipe logs to stdout when the message is too long.

This commit is contained in:
Hedden, Kyle Matthew 2024-05-02 17:03:03 -04:00
parent 9ff641060e
commit a5763d4516

View File

@ -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)... <stdio>") // 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)... <stdio>") // 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
}