WC_Log_Handler_File::get_log_file_name
Get a log file name.
File names consist of the handle, followed by the date, followed by a hash, .log.
Method of the class: WC_Log_Handler_File{}
No Hooks.
Returns
true|false|String. The log file name or false if cannot be determined.
Usage
$result = WC_Log_Handler_File::get_log_file_name( $handle );
- $handle(string) (required)
- Log name.
Changelog
| Since 3.3 | Introduced. |
WC_Log_Handler_File::get_log_file_name() WC Log Handler File::get log file name code WC 10.3.6
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;
}
}