How to print an array in logger in Drupal 10

// Logs an array or object

\Drupal::logger('module_name')->notice('<pre>'.print_r($array, TRUE).'</pre>');

Category