  
      if not os.path.exists(directory):
          directory = get_folder(directory)
  
      dir_scanned = sorted(os.scandir(directory), key=lambda x: x.name)
      logger.debug("Scanned Folder contains %s files", len(dir_scanned))
      logger.trace("Scanned Folder Contents: %s", dir_scanned)
  
 
</s> remove             if chkfile.name in exclude_names:
                if debug:
                    print("Already processed %s" % chkfile.name)
                continue
            else:
                dir_contents.append(chkfile.path)
 </s> add             logger.trace("Adding '%s' to image list", chkfile.path)
            dir_contents.append(chkfile.path) </s> remove     exclude_names = [os.path.basename(Path(x).stem[:Path(x).stem.rfind('_')] +
                                      Path(x).suffix) for x in exclude]
 </s> add  </s> remove             print(err)
 </s> add             logger.error(err) </s> remove         print("Creating group directories.")
 </s> add         logger.info("Creating group directories.")
        logger.debug("Creating folder: '%s'", directory)
  
      if not os.path.exists(directory):
        logger.debug("Creating folder: '%s'", directory)
          directory = get_folder(directory)
  
      dir_scanned = sorted(os.scandir(directory), key=lambda x: x.name)
      logger.debug("Scanned Folder contains %s files", len(dir_scanned))
      logger.trace("Scanned Folder Contents: %s", dir_scanned)
  
keep add keep keep keep keep keep keep
 Logging (#541)

* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training 
lib/utils.py