>> * @phpstan-return array, * }>> */ public function get_output() { $output = array(); /** @var QM_Data_Logger $data */ $data = $this->collector->get_data(); if ( empty( $data->logs ) ) { return $output; } foreach ( $data->logs as $log ) { $output[ $log['level'] ][] = array( 'message' => $log['message'], 'stack' => array_column( $log['filtered_trace'], 'display' ), ); } return $output; } } /** * @param array $output * @param QM_Collectors $collectors * @return array */ function register_qm_output_raw_logger( array $output, QM_Collectors $collectors ) { $collector = QM_Collectors::get( 'logger' ); if ( $collector ) { $output['logger'] = new QM_Output_Raw_Logger( $collector ); } return $output; } add_filter( 'qm/outputter/raw', 'register_qm_output_raw_logger', 30, 2 );