Stop logging with System.out.println, start using slf4j

This commit is contained in:
P0nk
2022-02-10 21:31:33 +01:00
parent c879e36a9c
commit 2bbfd46105
37 changed files with 227 additions and 160 deletions

View File

@@ -34,6 +34,8 @@ import net.AbstractPacketHandler;
import net.packet.InPacket;
import net.server.channel.Channel;
import net.server.world.World;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scripting.event.EventInstanceManager;
import server.ItemInformationProvider;
import tools.DatabaseConnection;
@@ -52,6 +54,7 @@ import java.sql.SQLException;
* @author Drago (Dragohe4rt) - on Wishlist
*/
public final class RingActionHandler extends AbstractPacketHandler {
private static final Logger log = LoggerFactory.getLogger(RingActionHandler.class);
private static int getEngagementBoxId(int useItemId) {
return switch (useItemId) {
@@ -175,7 +178,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
eraseEngagementOffline(characterId, con);
} catch (SQLException ex) {
System.out.println("Error updating offline breakup " + ex.getMessage());
log.error("Error updating offline breakup", ex);
}
}
@@ -361,7 +364,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
source.sendPacket(WeddingPackets.OnNotifyWeddingPartnerTransfer(target.getId(), target.getMapId()));
target.sendPacket(WeddingPackets.OnNotifyWeddingPartnerTransfer(source.getId(), source.getMapId()));
} catch (Exception e) {
System.out.println("Error with engagement " + e.getMessage());
log.error("Error with engagement", e);
}
} else {
source.dropMessage(1, "She has politely declined your engagement request.");
@@ -509,7 +512,7 @@ public final class RingActionHandler extends AbstractPacketHandler {
break;
default:
System.out.println("Unhandled RING_ACTION Mode: " + p);
log.warn("Unhandled RING_ACTION mode. Packet: {}", p);
break;
}