-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Logger and integrate LSH framework.
- Loading branch information
Conor Flynn
committed
Sep 20, 2022
1 parent
c6c4af8
commit 7796f44
Showing
28 changed files
with
356 additions
and
105 deletions.
There are no files selected for viewing
Binary file modified
BIN
+682 Bytes
(100%)
Data Engine/Documents/Internal Manual/Packet Spreadsheet.xlsx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| # === GENERAL PROPERTIES === | ||
|
|
||
| # delimiter used for internal processing | ||
| general.internal.delim=,., | ||
| general.internal.delim=,., | ||
|
|
||
| # enable all packet logging | ||
| general.logging.packets=true | ||
|
|
||
| # enable all response logging | ||
| general.logging.responses=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 39 additions & 4 deletions
43
DeFi-Data-Engine/DeFi Data Engine/src/main/java/org/core/logger/Logger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,45 @@ | ||
| package org.core.logger; | ||
|
|
||
| import org.framework.router.Router; | ||
| import java.time.Instant; | ||
|
|
||
| public class Logger extends Router { | ||
| import org.framework.router.Packet; | ||
| import org.framework.router.Response; | ||
|
|
||
| public Logger() { | ||
| super("logger", "LOG"); | ||
| public class Logger { | ||
|
|
||
| public static final void log(Packet packet) { | ||
| System.out.println(packetFormat(packet)); | ||
| } | ||
|
|
||
| public static final void log(Response response) { | ||
| System.out.println(responseFormat(response)); | ||
| } | ||
|
|
||
| public static final void terminate(Packet packet) { | ||
| System.err.println(packetFormat(packet)); | ||
| System.exit(1); | ||
| } | ||
|
|
||
| public static final void terminate(Response response) { | ||
| System.err.println(responseFormat(response)); | ||
| System.exit(1); | ||
| } | ||
|
|
||
| private static final String packetFormat(Packet packet) { | ||
| return String.format("[%s] [%-10s] PACKET - [%3s -> %3s] [%s] [%s]", | ||
| Instant.now().toString(), | ||
| Thread.currentThread().getName(), | ||
| packet.getSender(), | ||
| packet.getTag(), | ||
| packet.getData(), | ||
| packet.getSubData()); | ||
| } | ||
|
|
||
| private static final String responseFormat(Response response) { | ||
| return String.format("[%s] [%-10s] RESPONSE - [%3d] [%s]", | ||
| Instant.now().toString(), | ||
| Thread.currentThread().getName(), | ||
| response.code(), | ||
| response.data()); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.