Skip to content

Commit 0232bbb

Browse files
committed
changed logging of en- and decrypt to nexo-net-logger
1 parent 039fb26 commit 0232bbb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nexo-net-packet/src/main/java/com/nexoscript/nexonet/packet/PacketManager.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.nexoscript.nexonet.api.crypto.KeySize;
55
import com.nexoscript.nexonet.api.packet.IPacketManager;
66
import com.nexoscript.nexonet.api.packet.Packet;
7+
import com.nexoscript.nexonet.logger.LoggingType;
78
import com.nexoscript.nexonet.logger.NexonetLogger;
89
import com.nexoscript.nexonet.packet.crypto.CryptoManager;
910
import org.json.JSONObject;
@@ -49,9 +50,9 @@ public String toJson(Packet packet) {
4950
e.printStackTrace();
5051
}
5152
if(useEncryption) {
52-
System.out.println("[Crypto Decrypted] : " + json);
53+
this.logger.log(LoggingType.INFO, "[Crypto Decrypted] : " + json);
5354
String s = this.cryptoManager.encryptString(json.toString());
54-
System.out.println("[Crypto Encrypted] : " + s);
55+
this.logger.log(LoggingType.INFO, "[Crypto Encrypted] : " + s);
5556
return s;
5657
}
5758
return json.toString();
@@ -60,10 +61,10 @@ public String toJson(Packet packet) {
6061
public Packet fromJson(String jsonString) {
6162
try {
6263
String encrytedString = jsonString;
63-
System.out.println("[Crypto Encrypted] : " + encrytedString);
64+
this.logger.log(LoggingType.INFO, "[Crypto Encrypted] : " + encrytedString);
6465
if(useEncryption)
6566
encrytedString = this.cryptoManager.decryptString(jsonString);
66-
System.out.println("[Crypto Decrypted] : " + encrytedString);
67+
this.logger.log(LoggingType.INFO, "[Crypto Decrypted] : " + encrytedString);
6768
JSONObject json = new JSONObject(encrytedString);
6869
String type = json.getString("type");
6970
Class<? extends Packet> clazz = this.packetRegistry.get(type);

0 commit comments

Comments
 (0)