WC_Log_Handler_File::get_log_file_name( string $handle )
Get a log file name.
Description Description
File names consist of the handle, followed by the date, followed by a hash, .log.
Parameters Parameters
- $handle
-
(Required) Log name.
Return Return
(bool|string) The log file name or false if cannot be determined.
Source Source
File: includes/log-handlers/class-wc-log-handler-file.php
public static function get_log_file_name( $handle ) { if ( function_exists( 'wp_hash' ) ) { $date_suffix = date( 'Y-m-d', time() ); $hash_suffix = wp_hash( $handle ); return sanitize_file_name( implode( '-', array( $handle, $date_suffix, $hash_suffix ) ) . '.log' ); } else { wc_doing_it_wrong( __METHOD__, __( 'This method should not be called before plugins_loaded.', 'woocommerce' ), '3.3' ); return false; } }
Changelog Changelog
Version | Description |
---|---|
3.3 | Introduced. |