|
23 | 23 | import me.itzg.helpers.http.Uris; |
24 | 24 | import org.jetbrains.annotations.Blocking; |
25 | 25 | import org.reactivestreams.Publisher; |
| 26 | +import org.slf4j.event.Level; |
26 | 27 | import picocli.CommandLine.Command; |
27 | 28 | import picocli.CommandLine.ExitCode; |
28 | 29 | import picocli.CommandLine.Option; |
@@ -63,6 +64,9 @@ public class MulitCopyCommand implements Callable<Integer> { |
63 | 64 | @Option(names = "--skip-existing", defaultValue = "false") |
64 | 65 | boolean skipExisting; |
65 | 66 |
|
| 67 | + @Option(names = "--quiet-when-skipped", description = "Don't log when file exists or is up to date") |
| 68 | + boolean quietWhenSkipped; |
| 69 | + |
66 | 70 | @Option(names = "--ignore-missing-sources", description = "Don't log or fail exit code when any or all sources are missing") |
67 | 71 | boolean ignoreMissingSources; |
68 | 72 |
|
@@ -241,10 +245,12 @@ private Mono<Path> processRemoteSource(String source) { |
241 | 245 | log.info("Downloading {} from {}", file, uri); |
242 | 246 | break; |
243 | 247 | case SKIP_FILE_UP_TO_DATE: |
244 | | - log.info("The file {} is already up to date", file); |
| 248 | + log.atLevel(quietWhenSkipped ? Level.DEBUG : Level.INFO) |
| 249 | + .log("The file {} is already up to date", file); |
245 | 250 | break; |
246 | 251 | case SKIP_FILE_EXISTS: |
247 | | - log.info("The file {} already exists", file); |
| 252 | + log.atLevel(quietWhenSkipped ? Level.DEBUG : Level.INFO) |
| 253 | + .log("The file {} already exists", file); |
248 | 254 | break; |
249 | 255 | case DOWNLOADED: |
250 | 256 | break; |
|
0 commit comments