diff --git a/CHANGES.md b/CHANGES.md index c7526360c5..462f93cadb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,6 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Added -* Introduce `TimedLogger` to allow for logging of time taken by a task using slf4j ([#1590](https://github.com/diffplug/spotless/pull/1590)) * `npm`-based formatters now support caching of `node_modules` directory ([#1590](https://github.com/diffplug/spotless/pull/1590)) ### Fixed * Reduce logging-noise created by `npm`-based formatters ([#1590](https://github.com/diffplug/spotless/pull/1590) fixes [#1582](https://github.com/diffplug/spotless/issues/1582)) diff --git a/lib/src/main/java/com/diffplug/spotless/npm/NodeApp.java b/lib/src/main/java/com/diffplug/spotless/npm/NodeApp.java index 50ce8ccc5c..edac59bbfd 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/NodeApp.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/NodeApp.java @@ -22,8 +22,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.diffplug.spotless.TimedLogger; - public class NodeApp { private static final Logger logger = LoggerFactory.getLogger(NodeApp.class); diff --git a/lib/src/main/java/com/diffplug/spotless/npm/NodeModulesCachingNpmProcessFactory.java b/lib/src/main/java/com/diffplug/spotless/npm/NodeModulesCachingNpmProcessFactory.java index a995aac59f..0086064194 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/NodeModulesCachingNpmProcessFactory.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/NodeModulesCachingNpmProcessFactory.java @@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory; import com.diffplug.spotless.ProcessRunner.Result; -import com.diffplug.spotless.TimedLogger; public class NodeModulesCachingNpmProcessFactory implements NpmProcessFactory { diff --git a/lib/src/main/java/com/diffplug/spotless/npm/NodeServeApp.java b/lib/src/main/java/com/diffplug/spotless/npm/NodeServeApp.java index d811515971..c9311a5589 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/NodeServeApp.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/NodeServeApp.java @@ -21,7 +21,6 @@ import org.slf4j.LoggerFactory; import com.diffplug.spotless.ProcessRunner; -import com.diffplug.spotless.TimedLogger; public class NodeServeApp extends NodeApp { diff --git a/lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java b/lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java index e4a8dd0fcb..3f262c813c 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/NpmFormatterStepStateBase.java @@ -34,7 +34,6 @@ import com.diffplug.spotless.FormatterFunc; import com.diffplug.spotless.ProcessRunner.LongRunningProcess; import com.diffplug.spotless.ThrowingEx; -import com.diffplug.spotless.TimedLogger; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; diff --git a/lib/src/main/java/com/diffplug/spotless/TimedLogger.java b/lib/src/main/java/com/diffplug/spotless/npm/TimedLogger.java similarity index 98% rename from lib/src/main/java/com/diffplug/spotless/TimedLogger.java rename to lib/src/main/java/com/diffplug/spotless/npm/TimedLogger.java index 2badd435d2..537234fcee 100644 --- a/lib/src/main/java/com/diffplug/spotless/TimedLogger.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/TimedLogger.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.diffplug.spotless; +package com.diffplug.spotless.npm; import static com.diffplug.spotless.LazyArgLogger.lazy; @@ -25,10 +25,12 @@ import org.slf4j.Logger; +import com.diffplug.spotless.ThrowingEx; + /** * A logger that logs the time it took to execute a block of code. */ -public class TimedLogger { +class TimedLogger { public static final String MESSAGE_PREFIX_BEGIN = "[BEGIN] "; diff --git a/lib/src/test/java/com/diffplug/spotless/TimedLoggerTest.java b/lib/src/test/java/com/diffplug/spotless/npm/TimedLoggerTest.java similarity index 95% rename from lib/src/test/java/com/diffplug/spotless/TimedLoggerTest.java rename to lib/src/test/java/com/diffplug/spotless/npm/TimedLoggerTest.java index cb36bbfbc0..f08d4f1622 100644 --- a/lib/src/test/java/com/diffplug/spotless/TimedLoggerTest.java +++ b/lib/src/test/java/com/diffplug/spotless/npm/TimedLoggerTest.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.diffplug.spotless; +package com.diffplug.spotless.npm; -import static com.diffplug.spotless.TimedLogger.MESSAGE_PREFIX_BEGIN; -import static com.diffplug.spotless.TimedLogger.MESSAGE_PREFIX_END; -import static com.diffplug.spotless.TimedLogger.MESSAGE_SUFFIX_TOOK; +import static com.diffplug.spotless.npm.TimedLogger.MESSAGE_PREFIX_BEGIN; +import static com.diffplug.spotless.npm.TimedLogger.MESSAGE_PREFIX_END; +import static com.diffplug.spotless.npm.TimedLogger.MESSAGE_SUFFIX_TOOK; import java.util.Arrays; import java.util.LinkedList; @@ -31,7 +31,7 @@ import org.slf4j.event.Level; import org.slf4j.helpers.LegacyAbstractLogger; -import com.diffplug.spotless.TimedLogger.TestTicker; +import com.diffplug.spotless.npm.TimedLogger.TestTicker; class TimedLoggerTest { @@ -49,7 +49,7 @@ void setUp() { } @Test - void itDoesNotLogWhenLevelDisabled() throws InterruptedException { + void itDoesNotLogWhenLevelDisabled() { TestLogger logger = new TestLogger() { @Override