Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/main/java/de/craftsblock/craftsnet/logging/Logger.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.craftsblock.craftsnet.logging;

import org.intellij.lang.annotations.PrintFormat;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -32,7 +33,7 @@ public interface Logger {
* @param args Arguments referenced by the format specifiers in the format string.
* @since 3.5.2
*/
default void info(@NotNull String format, Object... args) {
default void info(@NotNull @PrintFormat String format, Object @Nullable ... args) {
info(format(format, args));
}

Expand All @@ -53,7 +54,7 @@ default void info(@NotNull String format, Object... args) {
* @param args Arguments referenced by the format specifiers in the format string.
* @since 3.5.2
*/
default void warning(@NotNull String format, Object... args) {
default void warning(@NotNull @PrintFormat String format, Object @Nullable ... args) {
warning(format(format, args));
}

Expand All @@ -74,7 +75,7 @@ default void warning(@NotNull String format, Object... args) {
* @param args Arguments referenced by the format specifiers in the format string.
* @since 3.5.2
*/
default void error(@NotNull String format, Object... args) {
default void error(@NotNull @PrintFormat String format, Object @Nullable ... args) {
error(format(format, args));
}

Expand Down Expand Up @@ -121,7 +122,8 @@ default void error(@NotNull Throwable throwable, @Nullable String comment) {
* @param args Arguments referenced by the format specifiers in the format string.
* @since 3.5.2
*/
default void error(@NotNull String format, @NotNull Throwable throwable, Object... args) {
default void error(@NotNull @PrintFormat String format, @NotNull Throwable throwable,
Object @Nullable ... args) {
error(format(format, args), throwable);
}

Expand All @@ -142,7 +144,7 @@ default void error(@NotNull String format, @NotNull Throwable throwable, Object.
* @param args Arguments referenced by the format specifiers in the format string.
* @since 3.5.2
*/
default void debug(@NotNull String format, Object... args) {
default void debug(@NotNull @PrintFormat String format, Object @Nullable ... args) {
debug(format(format, args));
}

Expand All @@ -152,7 +154,7 @@ default void debug(@NotNull String format, Object... args) {
* @param name The name for the cloned logger.
* @return A new {@code Logger} instance cloned from this logger with the given name.
*/
Logger cloneWithName(String name);
Logger cloneWithName(@Nullable String name);

/**
* Creates a clone of this {@link Logger} with a formatted name.
Expand All @@ -166,7 +168,7 @@ default void debug(@NotNull String format, Object... args) {
* @return A new {@code Logger} instance cloned from this logger with the formatted name.
* @since 3.5.2
*/
default Logger cloneWithName(String format, Object... args) {
default Logger cloneWithName(@NotNull @PrintFormat String format, Object @Nullable ... args) {
return cloneWithName(format(format, args));
}

Expand All @@ -180,7 +182,7 @@ default Logger cloneWithName(String format, Object... args) {
* @return A formatted string.
* @since 3.5.2
*/
default String format(@NotNull String format, Object... args) {
default String format(@NotNull @PrintFormat String format, Object @Nullable ... args) {
return String.format(format, args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void debug(@Nullable String text) {
* @return {@inheritDoc}
*/
@Override
public Logger cloneWithName(String name) {
public Logger cloneWithName(@Nullable String name) {
return new LoggerImpl(this.debug, name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void debug(@Nullable String text) {
* @return {@inheritDoc}
*/
@Override
public Logger cloneWithName(String name) {
public Logger cloneWithName(@Nullable String name) {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void debug(@Nullable String text) {
* @return {@inheritDoc}
*/
@Override
public Logger cloneWithName(String name) {
public Logger cloneWithName(@Nullable String name) {
return this;
}

Expand Down
Loading