use io_utils.print_msg in datset_utils
diff --git a/keras/utils/dataset_utils.py b/keras/utils/dataset_utils.py
index 35d234d6255..103f849bbc7 100644
--- a/keras/utils/dataset_utils.py
+++ b/keras/utils/dataset_utils.py
@@ -670,11 +670,13 @@ def get_training_or_validation_split(samples, labels, validation_split, subset):
 
     num_val_samples = int(validation_split * len(samples))
     if subset == "training":
-        print(f"Using {len(samples) - num_val_samples} files for training.")
+        io_utils.print_msg(
+            f"Using {len(samples) - num_val_samples} " f"files for training."
+        )
         samples = samples[:-num_val_samples]
         labels = labels[:-num_val_samples]
     elif subset == "validation":
-        print(f"Using {num_val_samples} files for validation.")
+        io_utils.print_msg(f"Using {num_val_samples} files for validation.")
         samples = samples[-num_val_samples:]
         labels = labels[-num_val_samples:]
     else:

Use of  io_utils.print_msg allows to send messages to python logging by setting:
https://www.tensorflow.org/api_docs/python/tf/keras/utils/disable_interactive_logging
instead of stdout (which remains default behavior if interactive logging is not disabled).
Tested on tf 2.12.