Package io.gitlab.ntduycse.util
Class LogUtils
java.lang.Object
io.gitlab.ntduycse.util.LogUtils
Logging helpers that enforce a consistent
[Spring] prefix and SLF4J-style placeholders.
Callers should route every Spring Quickstart log line through these helpers instead of calling
the underlying Gradle Logger directly, so the prefix stays in exactly one place.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDetail line:lifecyclewhenverbose=true,infootherwise.static voidSection header: emits a blank line followed by[Spring] <pattern>atlifecyclelevel.static booleanisVerbose(org.gradle.api.Project project, SpringQuickstartExtension extension) Resolves the effective verbose flag: the Gradle project property "spring.verbose" wins when set, otherwise the extension default (SpringQuickstartExtension.getVerbose()) is used.static voidlogDependencies(boolean verbose, List<PluginDependency>... dependencies) Logs a grouped, aligned "dependencies:" block at detail verbosity.static voidAlways-visible line atlifecyclelevel, prefixed with[Spring].static voidAlways-visible warning atwarnlevel, prefixed with[Spring].
-
Field Details
-
PREFIX
Single source of truth for the prefix added to every Spring Quickstart log line.- See Also:
-
VERBOSE_PROJECT_PROPERTY
Gradle project property that toggles verbose output without editing the build script.- See Also:
-
-
Method Details
-
detail
public static void detail(org.gradle.api.logging.Logger logger, boolean verbose, String pattern, Object... args) Detail line:lifecyclewhenverbose=true,infootherwise. Use for routine configuration values (dependency lists, compiler args, coverage exclusions).- Parameters:
logger- the loggerverbose- whether verbose output is enabledpattern- SLF4J-style pattern (without the[Spring]prefix)args- pattern arguments
-
header
Section header: emits a blank line followed by[Spring] <pattern>atlifecyclelevel. Use for the first line of each convention (e.g."Applying Jacoco convention").- Parameters:
logger- the loggerpattern- SLF4J-style pattern (without the[Spring]prefix)args- pattern arguments
-
isVerbose
public static boolean isVerbose(org.gradle.api.Project project, SpringQuickstartExtension extension) Resolves the effective verbose flag: the Gradle project property "spring.verbose" wins when set, otherwise the extension default (SpringQuickstartExtension.getVerbose()) is used.- Parameters:
project- the projectextension- the Spring Quickstart extension- Returns:
- whether verbose logging is enabled
-
logDependencies
@SafeVarargs public static void logDependencies(boolean verbose, List<PluginDependency>... dependencies) Logs a grouped, aligned "dependencies:" block at detail verbosity. Empty groups are skipped.- Parameters:
verbose- whether verbose output is enableddependencies- one or more groups of dependencies
-
status
Always-visible line atlifecyclelevel, prefixed with[Spring].- Parameters:
logger- the loggerpattern- SLF4J-style pattern (without the[Spring]prefix)args- pattern arguments
-
warn
Always-visible warning atwarnlevel, prefixed with[Spring].- Parameters:
logger- the loggerpattern- SLF4J-style pattern (without the[Spring]prefix)args- pattern arguments
-