mirror of
				https://github.com/TheAnachronism/docspell.git
				synced 2025-11-03 18:00:11 +00:00 
			
		
		
		
	Use more prominent log line to indicate start of processing
Issue: #530
This commit is contained in:
		@@ -35,6 +35,7 @@ object ItemHandler {
 | 
			
		||||
      analyser: TextAnalyser[F],
 | 
			
		||||
      regexNer: RegexNerFile[F]
 | 
			
		||||
  ): Task[F, Args, Unit] =
 | 
			
		||||
    logBeginning.flatMap(_ =>
 | 
			
		||||
      DuplicateCheck[F]
 | 
			
		||||
        .flatMap(args =>
 | 
			
		||||
          if (args.files.isEmpty) logNoFiles
 | 
			
		||||
@@ -47,6 +48,7 @@ object ItemHandler {
 | 
			
		||||
              .map(_ => ())
 | 
			
		||||
          }
 | 
			
		||||
        )
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
  def itemStateTask[F[_]: Sync, A](
 | 
			
		||||
      state: ItemState
 | 
			
		||||
@@ -131,11 +133,16 @@ object ItemHandler {
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
  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] =
 | 
			
		||||
    logWarn(
 | 
			
		||||
      "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 ============")
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user