23 package com.realtime.crossfire.jxclient.util;
25 import java.io.IOException;
26 import java.io.Writer;
27 import java.time.LocalDateTime;
28 import java.time.format.DateTimeFormatter;
29 import java.util.Locale;
30 import org.jetbrains.annotations.NotNull;
48 private static final DateTimeFormatter
FORMATTER = DateTimeFormatter.ofPattern(
"yyyy-MM-dd HH:mm:ss,SSS ", Locale.ENGLISH);
54 private final Object
sync =
new Object();
76 }
catch (
final IOException ex) {
77 System.err.println(
"Cannot write debug protocol: "+ex.getMessage());
79 throw new AssertionError(ex);
89 public void debugProtocolWrite(@NotNull
final CharSequence str, @NotNull
final Throwable throwable) {
96 for (Throwable t = throwable; t !=
null; t = t.getCause()) {
97 writer.append(t.getClass().getName());
99 for (Object stack : t.getStackTrace()) {
100 writer.append(stack.toString());
105 }
catch (
final IOException ex) {
106 System.err.println(
"Cannot write debug protocol: "+ex.getMessage());
108 throw new AssertionError(ex);