Skip to content

Commit

Permalink
1480: make TimedLogger package-private (PR feedback)
Browse files Browse the repository at this point in the history
  • Loading branch information
simschla committed Feb 27, 2023
1 parent 37694c1 commit 78ccbc9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions lib/src/main/java/com/diffplug/spotless/npm/NodeApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.slf4j.LoggerFactory;

import com.diffplug.spotless.ProcessRunner.Result;
import com.diffplug.spotless.TimedLogger;

public class NodeModulesCachingNpmProcessFactory implements NpmProcessFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.slf4j.LoggerFactory;

import com.diffplug.spotless.ProcessRunner;
import com.diffplug.spotless.TimedLogger;

public class NodeServeApp extends NodeApp {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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] ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand All @@ -49,7 +49,7 @@ void setUp() {
}

@Test
void itDoesNotLogWhenLevelDisabled() throws InterruptedException {
void itDoesNotLogWhenLevelDisabled() {

TestLogger logger = new TestLogger() {
@Override
Expand Down

0 comments on commit 78ccbc9

Please sign in to comment.