woocommerce_logger_log_message
Filter the logging message. Returning null will prevent logging from occurring since 5.3.
Использование
add_filter( 'woocommerce_logger_log_message', 'wp_kama_woocommerce_logger_log_message_filter', 10, 4 ); /** * Function for `woocommerce_logger_log_message` filter-hook. * * @param string $message Log message. * @param string $level One of: emergency, alert, critical, error, warning, notice, info, or debug. * @param array $context Additional information for log handlers. * @param object $handler The handler object, such as WC_Log_Handler_File. Available since 5.3. * * @return string */ function wp_kama_woocommerce_logger_log_message_filter( $message, $level, $context, $handler ){ // filter... return $message; }
- $message(строка)
- Log message.
- $level(строка)
- One of: emergency, alert, critical, error, warning, notice, info, or debug.
- $context(массив)
- Additional information for log handlers.
- $handler(объект)
- The handler object, such as WC_Log_Handler_File. Available since 5.3.
Список изменений
С версии 3.1 | Введена. |
Где вызывается хук
woocommerce_logger_log_message
woocommerce/includes/class-wc-logger.php 186
$filtered_message = apply_filters( 'woocommerce_logger_log_message', $message, $level, $context, $handler );