Route console output through the Log class

This commit is contained in:
Anatoli Drumi
2026-06-24 15:39:42 +03:00
committed by Sergey Ponomarev
parent 131ff0ec6e
commit ff3f9705cd
16 changed files with 34 additions and 18 deletions

View File

@ -48,7 +48,7 @@ public class Restarter {
Thread.sleep(2000);
}
catch (InterruptedException e) {
e.printStackTrace();
return;
}
try {

View File

@ -144,7 +144,7 @@ public final class Spark {
dialog.invoke();
});
} catch (Exception ex) {
ex.printStackTrace();
Log.error(ex);
}
}

View File

@ -160,7 +160,7 @@ public class Default {
}
catch ( IOException e )
{
e.printStackTrace();
Log.error(e);
}
}

View File

@ -380,7 +380,7 @@ public class SparkRes {
prb.load(resourceAsStream);
}
} catch (IOException e) {
e.printStackTrace();
Log.error(e);
}
}

View File

@ -15,6 +15,8 @@
*/
package org.jivesoftware.spark.component.browser;
import org.jivesoftware.spark.util.log.Log;
import java.awt.BorderLayout;
import java.net.MalformedURLException;
@ -43,7 +45,7 @@ public class EmbeddedBrowserViewer extends BrowserViewer {
UIManager.setLookAndFeel(laf);
}
catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
Log.error(e);
}
// browser.addContentListener(this);
}

View File

@ -247,7 +247,7 @@ public class ChatPrinter implements Printable {
}
catch(java.awt.print.PrinterException pe)
{
System.err.printf("Error: %s!\n",pe.toString());
Log.error("Error printing document", pe);
}
}

View File

@ -16,6 +16,7 @@
package org.jivesoftware.spark.ui;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.util.log.Log;
import javax.swing.Timer;
import javax.swing.JFrame;
@ -126,7 +127,6 @@ public class ShakeWindow {
long now = System.currentTimeMillis()/1000L;
long diff = now-startTime;
System.out.println(diff);
if(diff > seconds)
{
moveTimer.stop();

View File

@ -1,5 +1,7 @@
package org.jivesoftware.spark.ui.history;
import org.jivesoftware.spark.util.log.Log;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@ -160,7 +162,7 @@ public class HistoryMessage {
try {
return dateFormat.parse(dateToParse);
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
return Calendar.getInstance().getTime();
}

View File

@ -1,5 +1,7 @@
package org.jivesoftware.spark.ui.history;
import org.jivesoftware.spark.util.log.Log;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
@ -98,7 +100,7 @@ public class XMLHistoryFile extends AbstractHistoryFile {
doc.getDocumentElement().normalize();
return doc;
} catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace();
Log.error(e);
}
return null;
}

View File

@ -776,7 +776,7 @@ public class ReceiveFileTransfer extends JPanel {
URL url = new URL(filePath);
uri = url.toURI();
} catch (MalformedURLException | URISyntaxException ex) {
ex.printStackTrace();
Log.error(ex);
}
} else {
uri = new File(filePath).toURI();

View File

@ -15,6 +15,8 @@
*/
package com.jivesoftware.spark.plugin.apple;
import org.jivesoftware.spark.util.log.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -59,7 +61,7 @@ public class AppleProperties {
try {
props.store(new FileOutputStream(getConfigFile()), "Storing Apple/Growl properties");
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}

View File

@ -15,6 +15,8 @@
*/
package org.jivesoftware.spark.plugin.flashing;
import org.jivesoftware.spark.util.log.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -53,7 +55,7 @@ public class FlashingPreferences {
try {
props.store(new FileOutputStream(getConfigFile()), "");
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}

View File

@ -15,6 +15,8 @@
*/
package org.jivesoftware.spark.roar;
import org.jivesoftware.spark.util.log.Log;
import java.awt.Color;
import java.io.File;
import java.io.FileInputStream;
@ -99,7 +101,7 @@ public class RoarProperties {
try {
props.store(new FileOutputStream(getConfigFile()), "Storing ROAR properties");
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}

View File

@ -60,7 +60,7 @@ public class SpellcheckManager {
checker = new SpellChecker(getDictionary(language));
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}
@ -82,7 +82,7 @@ public class SpellcheckManager {
"personalDictionary.dict");
dict = new OpenOfficeSpellDictionary(dictionary, personalDictionary);
} catch (IOException e) {
e.printStackTrace();
Log.error(e);
}
return dict;
}
@ -123,7 +123,7 @@ public class SpellcheckManager {
}
}
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}
}

View File

@ -15,6 +15,8 @@
*/
package org.jivesoftware.spellchecker;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.plugin.Plugin;
@ -41,7 +43,7 @@ public class SpellcheckerPlugin implements Plugin {
listener = new SpellcheckChatRoomListener();
SparkManager.getChatManager().addChatRoomListener(listener);
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}

View File

@ -15,6 +15,8 @@
*/
package org.jivesoftware.spellchecker;
import org.jivesoftware.spark.util.log.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@ -51,7 +53,7 @@ public class SpellcheckerPreferences {
try {
props.store(new FileOutputStream(getConfigFile()), "");
} catch (Exception e) {
e.printStackTrace();
Log.error(e);
}
}