From e013a57f868b02e97766411189b8c5c54ecf7659 Mon Sep 17 00:00:00 2001 From: J2ObjC Team Date: Fri, 15 Dec 2023 11:39:43 -0800 Subject: [PATCH] Align the logging format of the IosLoggerBackend with the XLogger. Replaces the logging handler with a handler that supports the same format as the XLogger. Otherwise only the raw string is logged to console. PiperOrigin-RevId: 591315434 --- .../com/google/j2objc/util/logging/IOSLogHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jre_emul/Classes/com/google/j2objc/util/logging/IOSLogHandler.java b/jre_emul/Classes/com/google/j2objc/util/logging/IOSLogHandler.java index a8019057f4..2168eb91fd 100644 --- a/jre_emul/Classes/com/google/j2objc/util/logging/IOSLogHandler.java +++ b/jre_emul/Classes/com/google/j2objc/util/logging/IOSLogHandler.java @@ -122,7 +122,11 @@ public String format(LogRecord record) { private Object nativeLog; public IOSLogHandler() { - setFormatter(new IOSLogFormatter()); + this(new IOSLogFormatter()); + } + + public IOSLogHandler(Formatter customFormatter) { + setFormatter(customFormatter); } @Override