mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-07 15:45:59 +00:00
Use more prominent log line to indicate start of processing
Issue: #530
This commit is contained in:
parent
97dfcece97
commit
611e480eb4
@ -35,6 +35,7 @@ object ItemHandler {
|
|||||||
analyser: TextAnalyser[F],
|
analyser: TextAnalyser[F],
|
||||||
regexNer: RegexNerFile[F]
|
regexNer: RegexNerFile[F]
|
||||||
): Task[F, Args, Unit] =
|
): Task[F, Args, Unit] =
|
||||||
|
logBeginning.flatMap(_ =>
|
||||||
DuplicateCheck[F]
|
DuplicateCheck[F]
|
||||||
.flatMap(args =>
|
.flatMap(args =>
|
||||||
if (args.files.isEmpty) logNoFiles
|
if (args.files.isEmpty) logNoFiles
|
||||||
@ -47,6 +48,7 @@ object ItemHandler {
|
|||||||
.map(_ => ())
|
.map(_ => ())
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def itemStateTask[F[_]: Sync, A](
|
def itemStateTask[F[_]: Sync, A](
|
||||||
state: ItemState
|
state: ItemState
|
||||||
@ -131,11 +133,16 @@ object ItemHandler {
|
|||||||
)
|
)
|
||||||
|
|
||||||
private def logWarn[F[_]](msg: => String): Task[F, Args, Unit] =
|
private def logWarn[F[_]](msg: => String): Task[F, Args, Unit] =
|
||||||
Task(_.logger.warn(msg))
|
Task.log(_.warn(msg))
|
||||||
|
|
||||||
private def logNoFiles[F[_]]: Task[F, Args, Unit] =
|
private def logNoFiles[F[_]]: Task[F, Args, Unit] =
|
||||||
logWarn(
|
logWarn(
|
||||||
"No files to process! Either no files were given or duplicate check removed all."
|
"No files to process! Either no files were given or duplicate check removed all."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private def logBeginning[F[_]]: Task[F, Args, Unit] =
|
||||||
|
Task { ctx =>
|
||||||
|
val files = ctx.args.files.flatMap(_.name).mkString(", ")
|
||||||
|
ctx.logger.info(s"============ Start processing $files ============")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user