diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 7454180f2..41d9927a4 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/src/net/sourceforge/plantuml/AFileZipEntry.java b/src/net/sourceforge/plantuml/AFileZipEntry.java
index d016ddfa8..cd9a945fb 100644
--- a/src/net/sourceforge/plantuml/AFileZipEntry.java
+++ b/src/net/sourceforge/plantuml/AFileZipEntry.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@ import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SFile;
public class AFileZipEntry implements AFile {
@@ -75,7 +76,7 @@ public class AFileZipEntry implements AFile {
zis.closeEntry();
zis.close();
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
return null;
}
@@ -88,7 +89,7 @@ public class AFileZipEntry implements AFile {
is.close();
return true;
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
}
}
diff --git a/src/net/sourceforge/plantuml/BlockUml.java b/src/net/sourceforge/plantuml/BlockUml.java
index 62992f1d3..d9104e9cf 100644
--- a/src/net/sourceforge/plantuml/BlockUml.java
+++ b/src/net/sourceforge/plantuml/BlockUml.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -55,6 +55,7 @@ import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.error.PSystemErrorPreprocessor;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.preproc2.PreprocessorModeSet;
@@ -197,7 +198,7 @@ public class BlockUml {
final byte[] digest = msgDigest.digest();
return coder.encode(digest);
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
return "NOETAG";
}
}
diff --git a/src/net/sourceforge/plantuml/DirWatcher2.java b/src/net/sourceforge/plantuml/DirWatcher2.java
index 71f61d227..08df525b4 100644
--- a/src/net/sourceforge/plantuml/DirWatcher2.java
+++ b/src/net/sourceforge/plantuml/DirWatcher2.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
*
* Original Author: Arnaud Roques
*
- *
+ *
*/
package net.sourceforge.plantuml;
@@ -49,6 +49,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.preproc.FileWithSuffix;
public class DirWatcher2 {
@@ -98,7 +99,7 @@ public class DirWatcher2 {
modifieds.put(f, new FileWatcher(files));
return Collections.unmodifiableList(generatedImages);
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
return Collections.emptyList();
}
}
diff --git a/src/net/sourceforge/plantuml/EmbeddedDiagram.java b/src/net/sourceforge/plantuml/EmbeddedDiagram.java
index 65ec8ca70..574975da2 100644
--- a/src/net/sourceforge/plantuml/EmbeddedDiagram.java
+++ b/src/net/sourceforge/plantuml/EmbeddedDiagram.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml;
@@ -49,6 +49,7 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.Line;
import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SImageIO;
import net.sourceforge.plantuml.ugraphic.AffineTransformType;
@@ -81,9 +82,9 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom {
final BufferedImage im = getImage();
return new Dimension2DDouble(im.getWidth(), im.getHeight());
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Logger.error(e);
}
return new Dimension2DDouble(42, 42);
}
@@ -101,9 +102,9 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom {
final UShape image = new UImage(new PixelImage(im, AffineTransformType.TYPE_BILINEAR));
ug.draw(image);
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Logger.error(e);
}
}
diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java
index 21ae738cf..b2044074d 100644
--- a/src/net/sourceforge/plantuml/FileFormat.java
+++ b/src/net/sourceforge/plantuml/FileFormat.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@ import net.sourceforge.plantuml.braille.BrailleCharFactory;
import net.sourceforge.plantuml.braille.UGraphicBraille;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.StringBounderRaw;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.png.MetadataTag;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.svg.SvgGraphics;
@@ -56,9 +57,9 @@ import net.sourceforge.plantuml.ugraphic.debug.StringBounderDebug;
/**
* Format for output files generated by PlantUML.
- *
+ *
* @author Arnaud Roques
- *
+ *
*/
public enum FileFormat {
PNG("image/png"),
@@ -96,7 +97,7 @@ public enum FileFormat {
/**
* Returns the file format to be used for that format.
- *
+ *
* @return a string starting by a point.
*/
public String getFileSuffix() {
@@ -228,7 +229,7 @@ public enum FileFormat {
/**
* Check if this file format is Encapsulated PostScript.
- *
+ *
* @return true
for EPS.
*/
public boolean isEps() {
@@ -299,7 +300,7 @@ public enum FileFormat {
}
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
return false;
}
diff --git a/src/net/sourceforge/plantuml/GeneratedImageImpl.java b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
index a90d5fbf6..f949b251b 100644
--- a/src/net/sourceforge/plantuml/GeneratedImageImpl.java
+++ b/src/net/sourceforge/plantuml/GeneratedImageImpl.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@ import java.io.IOException;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.error.PSystemError;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SFile;
public class GeneratedImageImpl implements GeneratedImage {
@@ -88,7 +89,7 @@ public class GeneratedImageImpl implements GeneratedImage {
return cmp;
}
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
return this.description.compareTo(this2.getDescription());
}
diff --git a/src/net/sourceforge/plantuml/Log.java b/src/net/sourceforge/plantuml/Log.java
index 26be31d3f..9cc45079a 100644
--- a/src/net/sourceforge/plantuml/Log.java
+++ b/src/net/sourceforge/plantuml/Log.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -35,23 +35,34 @@
*/
package net.sourceforge.plantuml;
-public abstract class Log {
+import net.sourceforge.plantuml.log.Logger;
+
+public class Log {
private static final long start = System.currentTimeMillis();
public synchronized static void debug(String s) {
+ // noop
+ }
+
+ public static void println(Object s) {
+ // noop
+ }
+
+ public static void header(String s) {
+ // noop
}
public synchronized static void info(String s) {
if (OptionFlags.getInstance().isVerbose()) {
ProgressBar.clear();
- System.err.println(format(s));
+ Logger.error(format(s));
}
}
public synchronized static void error(String s) {
ProgressBar.clear();
- System.err.println(s);
+ Logger.error(s);
}
private static String format(String s) {
@@ -93,20 +104,5 @@ public abstract class Log {
sb.append(" Mo - ");
sb.append(s);
return sb.toString();
-
- }
-
- public static void println(Object s) {
- // if (header2.get() == null) {
- // System.err.println("L = " + s);
- // } else {
- // System.err.println(header2.get() + " " + s);
- // }
- }
-
- // private static final ThreadLocal header2 = new ThreadLocal<>();
- //
- public static void header(String s) {
- // header2.set(s);
}
}
diff --git a/src/net/sourceforge/plantuml/OptionFlags.java b/src/net/sourceforge/plantuml/OptionFlags.java
index f4b546d04..d981acdec 100644
--- a/src/net/sourceforge/plantuml/OptionFlags.java
+++ b/src/net/sourceforge/plantuml/OptionFlags.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.security.SecurityUtils;
@@ -217,7 +218,7 @@ public class OptionFlags {
ps.println();
} catch (FileNotFoundException e) {
Log.error("Cannot open " + logData);
- e.printStackTrace();
+ Logger.error(e);
}
}
}
@@ -229,7 +230,7 @@ public class OptionFlags {
ps.println();
} catch (FileNotFoundException e) {
Log.error("Cannot open " + logData);
- e.printStackTrace();
+ Logger.error(e);
}
}
diff --git a/src/net/sourceforge/plantuml/ProgressBar.java b/src/net/sourceforge/plantuml/ProgressBar.java
index 39264c1a5..119d558d2 100644
--- a/src/net/sourceforge/plantuml/ProgressBar.java
+++ b/src/net/sourceforge/plantuml/ProgressBar.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -36,35 +36,52 @@
package net.sourceforge.plantuml;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
public class ProgressBar {
+ private static final java.util.logging.Logger logger;
+
+ static {
+ logger = java.util.logging.Logger.getLogger("com.plantuml.ProgressBar");
+ logger.setUseParentHandlers(false);
+ logger.addHandler(new StdErrHandler());
+ }
+
private static boolean enable;
private static String last = null;
private static final AtomicInteger total = new AtomicInteger();
private static final AtomicInteger done = new AtomicInteger();
private synchronized static void print(String message) {
- clear();
- System.err.print(message);
+ logger.log(Level.INFO, buildClearMessage() + message);
last = message;
}
public synchronized static void clear() {
- if (last != null) {
- for (int i = 0; i < last.length(); i++) {
- System.err.print('\b');
- }
- for (int i = 0; i < last.length(); i++) {
- System.err.print(' ');
- }
- for (int i = 0; i < last.length(); i++) {
- System.err.print('\b');
- }
- }
+ logger.log(Level.INFO, buildClearMessage());
last = null;
}
+ private static String buildClearMessage() {
+ if (last != null) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < last.length(); i++) {
+ sb.append("\b");
+ }
+ for (int i = 0; i < last.length(); i++) {
+ sb.append(" ");
+ }
+ for (int i = 0; i < last.length(); i++) {
+ sb.append("\b");
+ }
+ return sb.toString();
+ }
+ return "";
+ }
+
public static void incTotal(int nb) {
total.addAndGet(nb);
printBar(done.intValue(), total.intValue());
@@ -77,9 +94,7 @@ public class ProgressBar {
if (total == 0) {
return;
}
- final String message = "[" + getBar(done, total) + "] " + done + "/" + total;
- print(message);
-
+ print("[" + getBar(done, total) + "] " + done + "/" + total);
}
private static String getBar(int done, int total) {
@@ -101,4 +116,30 @@ public class ProgressBar {
enable = value;
}
+ private static class StdErrHandler extends Handler {
+ public StdErrHandler() {
+ }
+
+ @Override
+ public void publish(LogRecord record) {
+ String message = record.getMessage();
+ System.err.print(message);
+ this.flush();
+ }
+
+ @Override
+ public void flush() {
+ System.err.flush();
+ }
+
+ /**
+ * Override {@code StreamHandler.close} to do a flush but not to close the output stream.
+ * That is, we do not close {@code System.err}.
+ */
+ @Override
+ public void close() {
+ flush();
+ }
+ }
}
+
diff --git a/src/net/sourceforge/plantuml/Run.java b/src/net/sourceforge/plantuml/Run.java
index 884ac5497..8bd63d3a4 100644
--- a/src/net/sourceforge/plantuml/Run.java
+++ b/src/net/sourceforge/plantuml/Run.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -58,6 +58,7 @@ import net.sourceforge.plantuml.code.NoPlantumlCompressionException;
import net.sourceforge.plantuml.code.Transcoder;
import net.sourceforge.plantuml.code.TranscoderUtil;
import net.sourceforge.plantuml.ftp.FtpServer;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.picoweb.PicoWebServer;
import net.sourceforge.plantuml.png.MetadataTag;
import net.sourceforge.plantuml.preproc.Stdlib;
@@ -403,7 +404,7 @@ public class Run {
return;
}
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
}
}
@@ -426,9 +427,9 @@ public class Run {
try {
manageFileInternal(f, option, error);
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
} catch (InterruptedException e) {
- e.printStackTrace();
+ Logger.error(e);
}
incDone(error.hasError());
}
diff --git a/src/net/sourceforge/plantuml/SignatureUtils.java b/src/net/sourceforge/plantuml/SignatureUtils.java
index 9f28a8f1e..993037993 100644
--- a/src/net/sourceforge/plantuml/SignatureUtils.java
+++ b/src/net/sourceforge/plantuml/SignatureUtils.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -50,6 +50,7 @@ import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import net.sourceforge.plantuml.code.AsciiEncoder;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SFile;
public class SignatureUtils {
@@ -77,10 +78,10 @@ public class SignatureUtils {
final byte[] digest = getMD5raw(s);
return toString(digest);
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
}
}
@@ -104,10 +105,10 @@ public class SignatureUtils {
assert digest.length == 16;
return toHexString(digest);
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
}
}
@@ -118,10 +119,10 @@ public class SignatureUtils {
assert digest.length == 64;
return toHexString(digest);
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
}
}
@@ -160,10 +161,10 @@ public class SignatureUtils {
final byte[] digest = msgDigest.digest();
return toString(digest);
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
}
}
@@ -194,10 +195,10 @@ public class SignatureUtils {
final byte[] digest = msgDigest.digest();
return toString(digest);
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new UnsupportedOperationException(e);
}
}
diff --git a/src/net/sourceforge/plantuml/SkinParam.java b/src/net/sourceforge/plantuml/SkinParam.java
index 7dd0f6369..5f5e9acf0 100644
--- a/src/net/sourceforge/plantuml/SkinParam.java
+++ b/src/net/sourceforge/plantuml/SkinParam.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -63,6 +63,7 @@ import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection;
import net.sourceforge.plantuml.skin.Padder;
@@ -111,7 +112,7 @@ public class SkinParam implements ISkinParam {
try {
this.styleBuilder = getCurrentStyleBuilderInternal();
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
}
return styleBuilder;
@@ -178,7 +179,7 @@ public class SkinParam implements ISkinParam {
this.muteStyle(modifiedStyle);
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
}
}
diff --git a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java
index 43fdd0e87..35747099f 100644
--- a/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java
+++ b/src/net/sourceforge/plantuml/SourceFileReaderAbstract.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -57,6 +57,7 @@ import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.api.ThemeStyle;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.error.PSystemError;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.preproc.FileWithSuffix;
import net.sourceforge.plantuml.security.SFile;
@@ -159,7 +160,7 @@ public abstract class SourceFileReaderAbstract implements ISourceFileReader {
try {
system = blockUml.getDiagram();
} catch (Throwable t) {
- t.printStackTrace();
+ Logger.error(t);
if (OptionFlags.getInstance().isSilentlyCompletelyIgnoreErrors() || noerror) {
continue;
}
diff --git a/src/net/sourceforge/plantuml/Splash.java b/src/net/sourceforge/plantuml/Splash.java
index de1871d23..26cbeb5a8 100644
--- a/src/net/sourceforge/plantuml/Splash.java
+++ b/src/net/sourceforge/plantuml/Splash.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@ import java.awt.image.BufferedImage;
import java.net.URL;
import java.util.concurrent.atomic.AtomicInteger;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.version.PSystemVersion;
public class Splash extends Window implements MouseListener, MouseMotionListener {
@@ -139,7 +140,7 @@ public class Splash extends Window implements MouseListener, MouseMotionListener
try {
Desktop.getDesktop().browse(new URL("https://plantuml.com").toURI());
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
}
return;
}
diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java
index 33e8425b3..85c73457d 100644
--- a/src/net/sourceforge/plantuml/TitledDiagram.java
+++ b/src/net/sourceforge/plantuml/TitledDiagram.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -261,7 +261,7 @@ public abstract class TitledDiagram extends AbstractPSystem implements Diagram,
final AnimationDecoder animationDecoder = new AnimationDecoder(animationData);
this.animation = Animation.create(animationDecoder.decode());
// } catch (ScriptException e) {
-// e.printStackTrace();
+// Logger.error(e);
// }
}
diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java
index e2a717704..b162c4e31 100644
--- a/src/net/sourceforge/plantuml/UmlDiagram.java
+++ b/src/net/sourceforge/plantuml/UmlDiagram.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -65,6 +65,7 @@ import net.sourceforge.plantuml.fun.IconLoader;
import net.sourceforge.plantuml.graphic.GraphicPosition;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.graphic.UDrawable;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.mjpeg.MJPEGGenerator;
import net.sourceforge.plantuml.pdf.PdfConverter;
import net.sourceforge.plantuml.security.SImageIO;
@@ -135,13 +136,13 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
this.lastInfo = new Dimension2DDouble(imageData.getWidth(), imageData.getHeight());
return imageData;
} catch (NoStyleAvailableException e) {
- // e.printStackTrace();
+ // Logger.error(e);
exportDiagramError(os, e, fileFormatOption, null);
} catch (UnparsableGraphvizException e) {
- e.printStackTrace();
+ Logger.error(e);
exportDiagramError(os, e.getCause(), fileFormatOption, e.getGraphvizVersion());
} catch (Throwable e) {
- // e.printStackTrace();
+ // Logger.error(e);
exportDiagramError(os, e, fileFormatOption, null);
}
return ImageDataSimple.error();
@@ -170,7 +171,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
im2 = utils.exportFlashcode(flash, Color.BLACK, Color.WHITE);
} catch (Throwable e) {
Log.error("Issue in flashcode generation " + e);
- // e.printStackTrace();
+ // Logger.error(e);
}
if (im2 != null)
GraphvizCrash.addDecodeHint(strings);
diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
index 0e3979353..b96e7feee 100644
--- a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
+++ b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java
@@ -47,6 +47,7 @@ import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import net.sourceforge.plantuml.core.UmlSource;
+import net.sourceforge.plantuml.log.Logger;
public class PSystemXearthFactory extends PSystemBasicFactory {
@@ -100,7 +101,7 @@ public class PSystemXearthFactory extends PSystemBasicFactory {
return system;
}
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
return null;
}
return null;
diff --git a/src/net/sourceforge/plantuml/ant/CheckZipTask.java b/src/net/sourceforge/plantuml/ant/CheckZipTask.java
index f30d2fbc7..d8943a080 100644
--- a/src/net/sourceforge/plantuml/ant/CheckZipTask.java
+++ b/src/net/sourceforge/plantuml/ant/CheckZipTask.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -44,6 +44,8 @@ import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import net.sourceforge.plantuml.log.Logger;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileList;
@@ -84,7 +86,7 @@ public class CheckZipTask extends Task {
manageFileList(fileList);
}
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new BuildException(e.toString());
}
}
diff --git a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
index 1dc486735..14cf1f34d 100644
--- a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
+++ b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@ import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
+import net.sourceforge.plantuml.log.Logger;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
@@ -130,10 +132,10 @@ public class PlantUmlTask extends Task {
}
this.log("Nb images generated: " + nbFiles.get());
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new BuildException(e.toString());
} catch (InterruptedException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new BuildException(e.toString());
}
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
index 00dc6c846..3e35fbd24 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed.java
@@ -3,12 +3,12 @@
* ========================================================================
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@ import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
+import net.sourceforge.plantuml.log.Logger;
+
@HaxeIgnored
public class NumberAnalyzed implements INumberAnalyzed {
@@ -121,7 +123,7 @@ public class NumberAnalyzed implements INumberAnalyzed {
Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong(
st.nextToken(), 36), Long.parseLong(st.nextToken(), 36));
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
Log.info("Error reading " + value);
return null;
}
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
index 3048c9adb..61810caca 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzed2.java
@@ -3,12 +3,12 @@
* ========================================================================
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@ import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
+import net.sourceforge.plantuml.log.Logger;
@HaxeIgnored
public class NumberAnalyzed2 implements INumberAnalyzed {
@@ -95,7 +96,7 @@ public class NumberAnalyzed2 implements INumberAnalyzed {
Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong(
st.nextToken(), 36), Long.parseLong(st.nextToken(), 36));
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
Log.info("Error reading " + value);
return null;
}
diff --git a/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java b/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java
index 19bc3aaf3..3cfb2062c 100644
--- a/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java
+++ b/src/net/sourceforge/plantuml/api/NumberAnalyzedDated.java
@@ -3,12 +3,12 @@
* ========================================================================
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@ import java.util.prefs.Preferences;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.annotation.HaxeIgnored;
+import net.sourceforge.plantuml.log.Logger;
@HaxeIgnored
public class NumberAnalyzedDated extends NumberAnalyzed {
@@ -104,7 +105,7 @@ public class NumberAnalyzedDated extends NumberAnalyzed {
Long.parseLong(st.nextToken(), 36), Long.parseLong(st.nextToken(), 36), Long.parseLong(
st.nextToken(), 36), st.nextToken());
} catch (Exception e) {
- e.printStackTrace();
+ Logger.error(e);
Log.info("Error reading " + value);
return null;
}
diff --git a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
index 8be93fa57..a24a9f95b 100644
--- a/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
+++ b/src/net/sourceforge/plantuml/api/TimeoutExecutor.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.api;
+import net.sourceforge.plantuml.log.Logger;
+
import java.util.concurrent.atomic.AtomicBoolean;
public final class TimeoutExecutor {
@@ -53,7 +55,7 @@ public final class TimeoutExecutor {
mainThread.join(ms);
} catch (InterruptedException e) {
System.err.println("TimeoutExecutorA " + e);
- e.printStackTrace();
+ Logger.error(e);
return false;
} finally {
done = mainThread.done.get();
@@ -80,7 +82,7 @@ public final class TimeoutExecutor {
done.set(true);
} catch (InterruptedException e) {
System.err.println("TimeoutExecutorB " + e);
- e.printStackTrace();
+ Logger.error(e);
}
}
diff --git a/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java b/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java
index 05c4bc64a..8112dfc62 100644
--- a/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java
+++ b/src/net/sourceforge/plantuml/argon2/blake2/Blake2b.java
@@ -26,6 +26,7 @@
package net.sourceforge.plantuml.argon2.blake2;
+import net.sourceforge.plantuml.log.Logger;
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.*;
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.*;
@@ -896,7 +897,7 @@ public interface Blake2b {
public final static String exclusiveLowerBound = "'%s' %d is <= %d";
public final static String inclusiveLowerBound = "'%s' %d is < %d";
static String assertFail(final String name, final T v, final String err, final T spec) {
- new Exception().printStackTrace();
+ Logger.error(new Exception());
return String.format(err, name, v, spec);
}
}
diff --git a/src/net/sourceforge/plantuml/code/CompressionBrotli.java b/src/net/sourceforge/plantuml/code/CompressionBrotli.java
index 12eff3780..57a1a2bd8 100644
--- a/src/net/sourceforge/plantuml/code/CompressionBrotli.java
+++ b/src/net/sourceforge/plantuml/code/CompressionBrotli.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -41,6 +41,7 @@ import java.io.IOException;
import net.sourceforge.plantuml.FileUtils;
import net.sourceforge.plantuml.brotli.BrotliInputStream;
+import net.sourceforge.plantuml.log.Logger;
public class CompressionBrotli implements Compression {
@@ -56,7 +57,7 @@ public class CompressionBrotli implements Compression {
FileUtils.copyToStream(brotli, result);
return ByteArray.from(result.toByteArray());
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
throw new NoPlantumlCompressionException(e);
}
}
diff --git a/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java b/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java
index be572fa40..1095dee16 100644
--- a/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java
+++ b/src/net/sourceforge/plantuml/code/CompressionZlibAttic.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@ public class CompressionZlibAttic implements Compression {
return ByteArray.from(result);
} catch (IOException e) {
- // e.printStackTrace();
+ // Logger.error(e);
throw new NoPlantumlCompressionException(e);
}
@@ -115,7 +115,7 @@ public class CompressionZlibAttic implements Compression {
final byte[] result = copyArray(tmp, resultLength);
return result;
} catch (DataFormatException e) {
- // e.printStackTrace();
+ // Logger.error(e);
throw new IOException(e.toString());
}
}
diff --git a/src/net/sourceforge/plantuml/code/Upf9Encoder.java b/src/net/sourceforge/plantuml/code/Upf9Encoder.java
index 9b41f8e17..e59e00ef8 100644
--- a/src/net/sourceforge/plantuml/code/Upf9Encoder.java
+++ b/src/net/sourceforge/plantuml/code/Upf9Encoder.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.code;
+import net.sourceforge.plantuml.log.Logger;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -56,7 +58,7 @@ public class Upf9Encoder {
if (c == Upf9Decoder.decodeChar(new ByteArrayInputStream(result)))
return true;
} catch (IOException e) {
- e.printStackTrace();
+ Logger.error(e);
}
return false;
}
diff --git a/src/net/sourceforge/plantuml/command/CommandSkinParam.java b/src/net/sourceforge/plantuml/command/CommandSkinParam.java
index e22667172..ebd8c0ebf 100644
--- a/src/net/sourceforge/plantuml/command/CommandSkinParam.java
+++ b/src/net/sourceforge/plantuml/command/CommandSkinParam.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml.command;
@@ -64,7 +64,7 @@ public class CommandSkinParam extends SingleLineCommand2 {
diagram.setParam(arg.get("NAME", 0), arg.get("VALUE", 0));
return CommandExecutionResult.ok();
} catch (NoStyleAvailableException e) {
- // e.printStackTrace();
+ // Logger.error(e);
return CommandExecutionResult.error("General failure: no style available.");
}
diff --git a/src/net/sourceforge/plantuml/command/ProtectedCommand.java b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
index d1295039e..85cad91fc 100644
--- a/src/net/sourceforge/plantuml/command/ProtectedCommand.java
+++ b/src/net/sourceforge/plantuml/command/ProtectedCommand.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml.command;
@@ -39,6 +39,7 @@ import java.util.Objects;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.core.Diagram;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.version.Version;
public class ProtectedCommand implements Command {
@@ -58,12 +59,11 @@ public class ProtectedCommand implements Command {
// }
return result;
} catch (Throwable t) {
- Log.error("Error " + t);
- t.printStackTrace();
+ Logger.error("Error ", t);
String msg = "You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V"
+ Version.versionString() + ")";
- Log.error(msg);
- msg += " " + t.toString();
+ Logger.error(msg);
+ msg += " " + t;
return CommandExecutionResult.error(msg, t);
}
}
diff --git a/src/net/sourceforge/plantuml/command/SkinLoader.java b/src/net/sourceforge/plantuml/command/SkinLoader.java
index cd707806b..7905f6735 100644
--- a/src/net/sourceforge/plantuml/command/SkinLoader.java
+++ b/src/net/sourceforge/plantuml/command/SkinLoader.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml.command;
@@ -106,7 +106,7 @@ public class SkinLoader {
}
return CommandExecutionResult.ok();
} catch (NoStyleAvailableException e) {
- // e.printStackTrace();
+ // Logger.error(e);
return CommandExecutionResult.error("General failure: no style available.");
}
diff --git a/src/net/sourceforge/plantuml/creole/atom/AtomImg.java b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java
index b93252a88..ab689df4b 100644
--- a/src/net/sourceforge/plantuml/creole/atom/AtomImg.java
+++ b/src/net/sourceforge/plantuml/creole/atom/AtomImg.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml.creole.atom;
@@ -54,6 +54,7 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.ImgValign;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TileImageSvg;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SImageIO;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.security.SURL;
@@ -120,38 +121,38 @@ public class AtomImg extends AbstractAtom implements Atom {
try {
// Check if valid URL
if (src.startsWith("http:") || src.startsWith("https:")) {
- if (src.endsWith(".svg"))
+ if (src.endsWith(".svg"))
return buildSvgFromUrl(src, fc, SURL.create(src), scale, url);
-
+
return buildRasterFromUrl(src, fc, SURL.create(src), scale, url);
}
final SFile f = FileSystem.getInstance().getFile(src);
if (f.exists() == false) {
- if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
+ if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
return AtomTextUtils.createLegacy("(File not found: " + f.getPrintablePath() + ")", fc);
-
+
return AtomTextUtils.createLegacy("(Cannot decode)", fc);
}
if (f.getName().endsWith(".svg")) {
final String tmp = FileUtils.readSvg(f);
- if (tmp == null)
+ if (tmp == null)
return AtomTextUtils.createLegacy("(Cannot decode)", fc);
-
+
return new AtomImgSvg(new TileImageSvg(tmp, scale));
}
final BufferedImage read = f.readRasterImageFromFile();
if (read == null) {
- if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
+ if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
return AtomTextUtils.createLegacy("(Cannot decode: " + f.getPrintablePath() + ")", fc);
-
+
return AtomTextUtils.createLegacy("(Cannot decode)", fc);
}
return new AtomImg(f.readRasterImageFromFile(), scale, url, src);
} catch (IOException e) {
- e.printStackTrace();
- if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
+ Logger.error(e);
+ if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
return AtomTextUtils.createLegacy("ERROR " + e.toString(), fc);
-
+
return AtomTextUtils.createLegacy("ERROR", fc);
}
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
index 7f2edaa2a..f6cdda0e9 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/GroupPrinter.java
@@ -5,12 +5,12 @@
* (C) Copyright 2009-2023, Arnaud Roques
*
* Project Info: http://plantuml.com
- *
+ *
* If you like this project or if you find it useful, you can support us at:
- *
+ *
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
- *
+ *
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
*
*
* Original Author: Arnaud Roques
- *
+ *
*
*/
package net.sourceforge.plantuml.cucadiagram;
@@ -38,6 +38,7 @@ package net.sourceforge.plantuml.cucadiagram;
import java.io.IOException;
import java.io.PrintWriter;
+import net.sourceforge.plantuml.log.Logger;
import net.sourceforge.plantuml.security.SFile;
public class GroupPrinter {
@@ -90,7 +91,7 @@ public class GroupPrinter {
new GroupPrinter(pw).printGroup(rootGroup);
pw.println("