forked from StarOpenSource/Engine
Rename message -> format for LoggerImpl
This commit is contained in:
parent
fc24ebef39
commit
e376e36eb3
4 changed files with 22 additions and 22 deletions
|
@ -46,20 +46,20 @@ public interface LoggerImpl {
|
||||||
*
|
*
|
||||||
* @param level log level
|
* @param level log level
|
||||||
* @param logIssuer log issuer
|
* @param logIssuer log issuer
|
||||||
* @param message log message
|
* @param format log format
|
||||||
* @return new log message
|
* @return new log format
|
||||||
* @since 1-alpha0
|
* @since 1-alpha0
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message);
|
String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsible for printing the finalized log message.
|
* Responsible for printing the finalized log message.
|
||||||
*
|
*
|
||||||
* @param level log level
|
* @param level log level
|
||||||
* @param logIssuer log issuer
|
* @param logIssuer log issuer
|
||||||
* @param message finalized log message
|
* @param format finalized log format
|
||||||
* @since 1-alpha0
|
* @since 1-alpha0
|
||||||
*/
|
*/
|
||||||
void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message);
|
void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,17 +56,17 @@ public class ColoredLoggerImpl implements LoggerImpl {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
// No modifications necessary
|
// No modifications necessary
|
||||||
return message;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@SuppressWarnings({ "resource" }) // Using try-with-resources will cause issues here
|
@SuppressWarnings({ "resource" }) // Using try-with-resources will cause issues here
|
||||||
@Override
|
@Override
|
||||||
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
// Convert to Ansi
|
// Convert to Ansi
|
||||||
Ansi output = new AnsiShortcodeConverter(message).getAnsi();
|
Ansi output = new AnsiShortcodeConverter(format).getAnsi();
|
||||||
|
|
||||||
// Print message
|
// Print message
|
||||||
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
|
|
|
@ -54,21 +54,21 @@ public class PlainLoggerImpl implements LoggerImpl {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
// No modifications necessary
|
// No modifications necessary
|
||||||
return message;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
message = new EmptyShortcodeConverter(message).getClean();
|
format = new EmptyShortcodeConverter(format).getClean();
|
||||||
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
||||||
System.out.println(message);
|
System.out.println(format);
|
||||||
else
|
else
|
||||||
System.err.println(message);
|
System.err.println(format);
|
||||||
else
|
else
|
||||||
System.out.println(message);
|
System.out.println(format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,20 +54,20 @@ public class RawLoggerImpl implements LoggerImpl {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public String postPlaceholder(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
// No modifications necessary
|
// No modifications necessary
|
||||||
return message;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
public void print(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String format) {
|
||||||
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
if (level == LogLevel.ERROR || level == LogLevel.CRASH)
|
||||||
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
if (EngineConfiguration.getInstance().isLoggerForceStandardOutput())
|
||||||
System.out.println(message);
|
System.out.println(format);
|
||||||
else
|
else
|
||||||
System.err.println(message);
|
System.err.println(format);
|
||||||
else
|
else
|
||||||
System.out.println(message);
|
System.out.println(format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue