-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from rec-jvm/v2
v2 prototype
- Loading branch information
Showing
120 changed files
with
168,431 additions
and
2,178 deletions.
There are no files selected for viewing
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,13 +1,19 @@ | ||
.idea/ | ||
.gradle/ | ||
out/ | ||
loadData/ | ||
|
||
/*.txt | ||
/*.net.kimleo.rec | ||
/*.rec | ||
/*.patch | ||
/default.rule | ||
|
||
.DS_Store | ||
build | ||
classes/ | ||
classes/ | ||
|
||
*.txt | ||
*.bin | ||
|
||
logs/ | ||
|
||
*.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
allprojects { | ||
version = '0.1.3' | ||
version = '0.2.0' | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ava/net/kimleo/rec/concept/Indexible.java → ...va/net/kimleo/rec/concept/Accessible.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
11 changes: 11 additions & 0 deletions
11
common/src/main/java/net/kimleo/rec/exception/InitializationException.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package net.kimleo.rec.exception; | ||
|
||
public class InitializationException extends RuntimeException { | ||
public InitializationException(String s, Exception ex) { | ||
super(s, ex); | ||
} | ||
|
||
public InitializationException(String message) { | ||
super(message); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
common/src/main/java/net/kimleo/rec/exception/ResourceAccessException.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package net.kimleo.rec.exception; | ||
|
||
public class ResourceAccessException extends RuntimeException { | ||
public ResourceAccessException(String message, Exception ex) { | ||
super(message, ex); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.kimleo.rec.logging; | ||
|
||
public interface LogAppender { | ||
void append(String logEntry); | ||
} |
5 changes: 5 additions & 0 deletions
5
common/src/main/java/net/kimleo/rec/logging/LogFormatter.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package net.kimleo.rec.logging; | ||
|
||
public interface LogFormatter { | ||
String format(String name, LoggingLevel level, String message); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.kimleo.rec.logging; | ||
|
||
import static net.kimleo.rec.logging.LoggingLevel.*; | ||
|
||
public interface Logger { | ||
default void trace(String msg) { | ||
log(TRACE, msg); | ||
} | ||
default void debug(String msg) { | ||
log(DEBUG, msg); | ||
} | ||
default void info(String msg) { | ||
log(INFO, msg); | ||
} | ||
default void warn(String msg) { | ||
log(WARN, msg); | ||
} | ||
default void error(String msg) { | ||
log(ERROR, msg); | ||
} | ||
|
||
void log(LoggingLevel level, String msg); | ||
} |
19 changes: 19 additions & 0 deletions
19
common/src/main/java/net/kimleo/rec/logging/LoggingLevel.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.kimleo.rec.logging; | ||
|
||
public enum LoggingLevel { | ||
TRACE(0), | ||
DEBUG(1), | ||
INFO(2), | ||
WARN(3), | ||
ERROR(4); | ||
|
||
private final int level; | ||
|
||
LoggingLevel(int level){ | ||
this.level = level; | ||
} | ||
|
||
public int level() { | ||
return level; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
common/src/main/java/net/kimleo/rec/logging/impl/DefaultLogger.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.kimleo.rec.logging.impl; | ||
|
||
import net.kimleo.rec.logging.LogAppender; | ||
import net.kimleo.rec.logging.LogFormatter; | ||
import net.kimleo.rec.logging.Logger; | ||
import net.kimleo.rec.logging.LoggingLevel; | ||
|
||
public class DefaultLogger implements Logger { | ||
private final String name; | ||
private final LoggingLevel loggingLevel; | ||
private final LogFormatter logFormatter; | ||
private final LogAppender appender; | ||
|
||
public DefaultLogger(String name, LoggingLevel loggingLevel, LogFormatter logFormatter, LogAppender appender) { | ||
this.name = name; | ||
this.loggingLevel = loggingLevel; | ||
this.logFormatter = logFormatter; | ||
this.appender = appender; | ||
} | ||
|
||
@Override | ||
public void log(LoggingLevel level, String msg) { | ||
if (level.level() >= loggingLevel.level()) { | ||
appender.append(logFormatter.format(name, level, msg)); | ||
} | ||
} | ||
} |
Oops, something went wrong.