Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/brenoepics/at4j
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Apr 30, 2024
2 parents 9d7c006 + ea90695 commit d1a8936
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@

/** This class is used to get a {@link Logger} instance. */
public class LoggerUtil {
LoggerUtil() {
throw new UnsupportedOperationException();
}
LoggerUtil() {
throw new UnsupportedOperationException();
}

/**
* Get or create a logger with the given name.
*
* @param name The name of the logger.
* @return The logger with the given name.
*/
public static Logger getLogger(String name) {
return LoggerFactory.getLogger(name);
}
/**
* Get or create a logger with the given name.
*
* @param name The name of the logger.
* @return The logger with the given name.
*/
public static Logger getLogger(String name) {
return LoggerFactory.getLogger(name);
}

/**
* Gets or creates a logger for the given class.
*
* @param clazz The class of the logger.
* @return A logger for the given class.
*/
public static Logger getLogger(Class<?> clazz) {
return LoggerFactory.getLogger(clazz);
}
}
/**
* Gets or creates a logger for the given class.
*
* @param clazz The class of the logger.
* @return A logger for the given class.
*/
public static Logger getLogger(Class<?> clazz) {
return LoggerFactory.getLogger(clazz);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.IOException;
import java.net.http.HttpResponse;
import java.util.Optional;

/** The result of a {@link RestRequest}. */
public class RestRequestResult {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ void logTraceMessageTest() {
String message = "This is a secret trace message";
Marker marker = Mockito.mock(Marker.class);
protectedLogger.handleNormalizedLoggingCall(Level.TRACE, marker, message, null, null);
verify(delegate).trace(eq(marker), eq("This is a ********** trace message"), isNull(), isNull());
verify(delegate)
.trace(eq(marker), eq("This is a ********** trace message"), isNull(), isNull());
}

@Test
Expand All @@ -46,7 +47,8 @@ void logDebugMessageTest() {
String message = "This is a secret debug message";
Marker marker = Mockito.mock(Marker.class);
protectedLogger.handleNormalizedLoggingCall(Level.DEBUG, marker, message, null, null);
verify(delegate).debug(eq(marker), eq("This is a ********** debug message"), isNull(), isNull());
verify(delegate)
.debug(eq(marker), eq("This is a ********** debug message"), isNull(), isNull());
}

@Test
Expand All @@ -66,7 +68,8 @@ void logErrorMessageTest() {
String message = "This is a secret error message";
Marker marker = Mockito.mock(Marker.class);
protectedLogger.handleNormalizedLoggingCall(Level.ERROR, marker, message, null, null);
verify(delegate).error(eq(marker), eq("This is a ********** error message"), isNull(), isNull());
verify(delegate)
.error(eq(marker), eq("This is a ********** error message"), isNull(), isNull());
}

@Test
Expand Down

0 comments on commit d1a8936

Please sign in to comment.